Magnesium-based battery production plant