Dispersion forces such as van der Waals forces between two microscopic particles, the Casimir-Polder forces between a particle and a macroscopic object, or the Casimir force between two dielectric objects are well studied in vacuum. However, in realistic situations the interacting objects are often embedded in an environmental medium. Such a solvent influences the induced dipole interaction. With the framework of macroscopic quantum electrodynamics, these interactions are mediated via an exchange of virtual photons. Via this method the impact of a homogeneous solvent medium can be expressed as local-field corrections leading to excess polarizabilities which have previously been derived for hard boundary conditions. In order to develop a more realistic description, we investigate a one-dimensional analog system illustrating the influence of a continuous dielectric profile.