I need an image with all 3 items in the same container, I know it is not a good practice, I know docker is solving the scalability, redundancy and availability issues by splitting services, etc. For all my projects I separate the services but for this project in specific I need all 3 services running under the same container.
So far I can run apache or mysql but not both at the same time, some issues with the entrypoints, some issues with the mysql permissions and I still haven't been able to get them all together in the same container up and running.
Has anyone faced this issue? Maybe some documentation I have missed?
Thank you
I've solved this before for a purely-local dev testing environment (because as you stated, this isn't normally a good practice).
What I did was start my Docker image from Alpine Linux, and then installed PHP, MySQL, and Nginx on top of it. You'll also need to COPY your source files into the container and set their appropriate permissions with chmod
or chown
.
Alternatively, you can use a volume as well, but depending on your OS you might run into permissions issues unless you create the same user/group in your container that owns the files on your local system.
If you'd like some inspiration, you can view the Dockerfile for the container that I've mentioned in the above.