title: Docker: 4 Containers for Frontend, Backend, Database, Push-Server?
body: <p>I am just getting started with docker and I am trying to figure out how to deploy our webapplication.
  We got:</p>
  
  <ul>
  <li>ReactJS Webapplication &amp; Workbench Frontend (Non-isomorph, Apache)</li>
  <li>Java / Wildfly Server Backend</li>
  <li>PostgreSQL Database</li>
  <li>NodeJS Websocket Server for push-notifications</li>
  </ul>
  
  <p>My first approach was to put it all inside one ubuntu-container and just deploy that. This lead into an awefully long dockerfile so I thought that cannot be the right way and <a href="https://developers.redhat.com/blog/2016/02/24/10-things-to-avoid-in-docker-containers/" rel="noreferrer">I googled best practices</a> and came to the point that each container should have only one concern.</p>
  
  <p>Does that mean that I should use one container for each of the above mentioned processes and link them, which would result in 4 running containers (the database one having a volume)?</p>
  
  <p>The advantages I see right now are:</p>
  
  <ul>
  <li>scalability</li>
  <li>maintainability</li>
  <li>moving parts of the application to different servers / hosters is easier</li>
  </ul>
  
  <p>The only two disadvantages I can think of are</p>
  
  <ul>
  <li>might get complicated linking all containers together </li>
  <li>(small) performance loss due to 4 containers running instead of 1 single one (and more to come for queueing, mail-server, ...)</li>
  </ul>