Table of Contents

How to start multiple processes in Docker?

About

To run multiple services in a single container there are multiple ways

Solutions

Script

With a script:

Example of script:

#!/bin/bash
set -m # to make job control work
/app/server &
/app/server -bar &
fg %1 

Docker file with the ENTRYPOINT instruction

ADD multiple.sh /app/
ENTRYPOINT /app/multiple.sh

Process Manager

A process manager can start more than one process.

Example with overmind

web: bundle exec rails server -p $PORT
foo: /app/foo
ADD Procfile /app/
CMD overmind start