Hi, my first docker project and learning a lot through the docker step by step manual. But I need some advise on the workflow I should use for my project. I’ve written an app in PHP that uses apache and MySQL. The app talks to an online API every 5min and stores the data it retrieved in the MySQL DB. When my project is finished I would like people to use any online docker (or local) and just download my app and run it.
What I’m thinking of now is making two containers:
- Apache + PHP
- MySQL + static volume to store the db files on
- About the Apache + PHP container, when I put my PHP files in the image, what would be the best way to update those files when I update or add new features? Should I also add Git in this image and have the user periodically pull updates?
- Or, should I build a new image for every update / feature and have the user pull a new image? Shutdown the running container and deploy a new container with the latest image.
- MySQL is running in a different container and I’m using a config.php file that contains the connection IP to the MySQL DB. How can I have the Apache/PHP container find out the IP address of the MySQL DB?
Any help is appreciated.