The ABYC Standards that apply to battery installation, Section E-10.7, are a bit lengthy. Call ABYC for the full details.
The main points, paraphrased and abbreviated:
Provide for containing electrolyte leakage or spillage (up to complete leakout), and isolate it from any boat structure that can be attacked by the electrolyte, including fastenings that secure the battery.
The battery should not move more than one inch in any direction (even upside down) when 90 lbs. of pulling force (or twice the weight of the battery, whichever is less) is applied for one minute.
Each battery terminal shall be protected from contact with metallic objects.
It may not be mounted above or below a fuel tank, fuel line fitting or fuel filter. Each metallic fuel line or fuel system component within 12 inches of a terminal or above the horizontal plane of the terminal shall be protected with dielectric material.
A venting system or other means shall be provided to permit the discharge of hydrogen gas released by the battery. (This includes plastic battery boxes and sealed batteries. See ABYC Standard H-2, Ventilation)
Batteries shall be charged by means of an automatically controlled device that is capable of applying the current and voltage appropriate to the type of battery being charged.