I newbie in docker and I cant find answer what solution is more "right" for LAMP stack:

1) One "standalone" container that will consist from Apache, PHP, MySQL, etc

2) Special container for each component, build and run project via docker-composer.

Im tried to take a look on foreigh realisations of LAMP in docker, but found both variants. Maybe my question dont have right answer and for each project solution must be individual?


I would go with solution 2: use docker-compose. The idea is that with solution 2 you can easily update mysql for example without having to modify and rebuild your dockerfile. you just have to update the version of the mysql image in the docker compose file.

I found with a quick search on github this repository https://github.com/sprintcube/docker-compose-lamp

Note: for production, use terraform script rather than docker-compose

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.