Docker Community Forums

Share and learn in the Docker community.

Volumes issues with a php application


(Tpeudupin) #1

Hi everyone,

I’m trying to “Dockerize” a php application developped by my company and i’m facing several understanding issue on how i should use the volume.

The application have two directories that must be persistents, one containing configurations files and the second containing imported user data such as png, pdf, …

I tried to COPY the code in the image in the dockerfiles but i lost everything inside my two folder as soon as i create my container with the volumes.

I actually wants my volumes to be filled with what i copied in my image.

I know I could just make a volumes on the application itself and dont COPY the code in the image, but i’d really like to have a “stand-alone” image, without having to git clone the code every time i deploy. As the image would be used in production environment.

Could someone help me to understand what i’m doing wrong ?
I would gladely provide any additionnal informations.

Thanks in advance.