Answers: <p>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.</p>
  
  <p>I found with a quick search on github this repository <a href="https://github.com/sprintcube/docker-compose-lamp" rel="nofollow noreferrer">https://github.com/sprintcube/docker-compose-lamp</a> </p>
  
  <p>Note: for production, use terraform script rather than docker-compose</p>
  
Answers: CC BY-SA 4.0
Answers: 2019-05-30T21:09:16.797Z
Answers: 2019-05-30T21:09:16.797Z
Answers: fredericrous
Body: <p>I newbie in docker and I cant find answer what solution is more "right" for LAMP stack: </p>
  
  <p>1) One "standalone" container that will consist from Apache, PHP, MySQL, etc</p>
  
  <p>2) Special container for each component, build and run project via docker-composer.</p>
  
  <p>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?</p>
  
Tags: <docker>
Title: LAMP in docker must be multiple containers or one?
UserDisplayName: Rikipm
ThreadText: # LAMP in docker must be multiple containers or one?
  
  (Asked by: username_0 on 2019-05-30)
  
  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?
  
  **Tags:** docker
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-05-30. Score: 1 | Accepted answer
  
  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
  
  
  ---
  
  