Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Docker Advice: PHP Application

Any advice would be greatly appreciated. I’m containerizing our old legacy applications.

I’m not sure what the best container setup would be, so far I’m looking at creating the following.

Container 1: Nginx
Container 2: PHP-FPM + Web Application (Composer+Node)
Container 3: PHP-FPM + REST API (Composer)
Container 4: PHP-FPM + Mobile API (Composer)

The issue that I have is relating to the application source. Containers 3 and 4 also need the source that is in container 2. Container 1 needs the source of all the other containers to serve static content.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

For dev this is not an issue as you just mount the local source. For production would I use a top level volume in docker-compose.yml to include the source from the other volumes?

>Solution :

I would just COPY the application sources into all the images. At this point, anything else is an example of premature optimization, which would make the overall infrastructure more complicated and more fragile.

Disk space costs next to nothing nowadays. On the other hand, the simplicity and robustness of the infrastructure are extremely valuable.

Think about ways to optimize your image sizes only after it causes real problems.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading