We calculate the finite vacuum energy density of the scalar and electromagnetic fields inside a Casimir apparatus made up of two conducting parallel plates in a general weak gravitational field. The metric of the weak gravitational field has a small deviation from flat spacetime inside the apparatus, and we find it by expanding the metric in terms of small parameters of the weak background. We show that the metric found can be transformed via a gauge transformation to the Fermi metric. We solve the Klein-Gordon equation exactly and find mode frequencies in Fermi spacetime. Using the fact that the electromagnetic field can be represented by two scalar fields in the Fermi spacetime, we find general formulas for the energy density and mode frequencies of the electromagnetic field. Some well-known weak backgrounds are examined and consistency of the results with the literature is shown.