title: Setting up PHP-FPM, Nginx, Mariadb on CentOs using docker
body: <p>I'm trying to move from from using VirtualBox as my development environment to docker. </p>
  
  <p>With VirtualBox, I mainly install PHP-FPM, Nginx and Mariadb but in Docker, I can't replicate the same stack despite trying for some days. </p>
  
  <p>Out of all the LEMP/LAMP stack docker guides, only this one <a href="https://github.com/chentex/docker-nginx-centos" rel="noreferrer">chentex/docker-nginx-centos</a> works for me: </p>
  
  <p>Here is the code from the <code>Dockerfile</code></p>
  
  <pre><code>FROM centos:centos7
  LABEL maintainer="Vicente Zepeda &lt;chente.z.m@gmail.com&gt;"
  
  ENV nginxversion="1.12.2-1" \
      os="centos" \
      osversion="7" \
      elversion="7_4"
  
  RUN yum install -y wget openssl sed &amp;&amp;\
      yum -y autoremove &amp;&amp;\
      yum clean all &amp;&amp;\
      wget http://nginx.org/packages/$os/$osversion/x86_64/RPMS/nginx-$nginxversion.el$elversion.ngx.x86_64.rpm &amp;&amp;\
      rpm -iv nginx-$nginxversion.el$elversion.ngx.x86_64.rpm &amp;&amp;\
      sed -i '1i\
      daemon off;\
      ' /etc/nginx/nginx.conf
  
  CMD ["nginx"]
  </code></pre>
  
  <p>This works right out of the box, and I can see a default page on <code>http://localhost</code></p>
  
  <p>The only problem is that, it does not contain PHP-FPM and Mariadb. </p>
  
  <p>I tried to alter the file and add PHP-FPM and Mariadb, but I found out on reddit that each container should have on service, as in one container for nginx, and another for php ... and I'm lost on how to make that</p>