Any town by vote at town meeting and any city by vote of the city councils may unite with any other town or city to form a district department of health. The affairs of any such district department of health shall be managed by a board as hereinafter provided.