IF are about to install that many different services, make sure to start from a base image made to manage them.
Use phusion/baseimage-docker
(which always starts the my_init
script, to take care of the zombie processes)
In that image, you can define multiple program (daemon) to run:
You only have to write a small shell script which runs your daemon, and runit
will keep it up and running for you, restarting it when it crashes, etc.
The shell script must be called run
, must be executable, and is to be placed in the directory /etc/service/<NAME>
.
If your base image has a /etc/service/helper/run
script, then any image based on it would run helper
, plus any other /etc/service/xxx/run
script of your own: replace xxx by the running services like nginx, django, postgresSQL.
You wouldn't need it for python3 (which is simply called, but doesn't run in the background)