Docker - run only one process per container


Docker best practice:

Run only one process per container to make it easier to reuse and scale each of the individual services:

  1. Scaling - With each service being in a separate container, you can scale one of your web servers horizontally as needed to handle more traffic.
  2. Reusability - Perhaps you have another service that needs a containerized database. You can simply reuse the same database container without bringing two unnecessary services along with it.
  3. Logging - Coupling containers makes logging much more complex.
  4. Portability and Predictability - It's much easier to make security patches or debug an issue when there's less surface area to work with.