In my docker compose file, I specify two services: phpant (a custom image derived from debian with PHP compiled and postfix running so PHP can actually send emails) and a mysqldb service that pulls the latest from the docker hub.
In the phpant service, I define a volume:
volumes:
- "/var/www/html/config/"
After installation, we write config files to this folder. We are using a volume because we want the config data to persist even if we roll out a new / updated image.
However, when we push a new image, it's losing the config files, and this directory ends up empty.
What did I do wrong? How do I get the data volume to persist even after I update the docker image for that service?
Note: The Wordpress image appears to do this correctly, which is where I got the idea in the first place. I tried to emulate what they did, but clearly, I have skipped / missed a step.