This is a CentOS-7 Docker million12/centos-supervisor image, perfect in case when you need to launch more then one process inside a container. This image is based on official centos:centos7 and it adds only ca. 20MB on top of it.
Things included:
Add your .sh scripts to /config/init
to have them executed when container starts. The bootstrap script is configured to run them just before supervisord starts. See million12/nginx for examples.
Just add you supervisord config(s) to /etc/supervisor.d/
directory to launch your service. For example in your Dockerfile
you could put:
ADD my-supervisord-service.conf /etc/supervisor.d/my-supervisord-service.conf
Learn more about about supervisord inside containers on official Docker documentation.
Logfile for supervisord is switched off to avoid logging inside container. Instead, all logs are easily available via docker logs [container name]
.
This is probably the best approach if you'd like to source your logs from outside the container via docker logs
(also via CoreOS `journald') and you don't want to worry about logging and log management inside your container and/or data volume.
The /data
directory is meant to be used to simply and easily deploy web applications using a volume binding on /data
, presumably using data only containers pattern.
Recommended structure:
/data/run/ # pid, sockets
/data/conf/ # extra configs for your services
/data/logs/ # logs
/data/www/ # your web application data
This container is configured to run your service(s) both in interactive and non-interactive mode (see bootstrap.sh script).
docker run -it million12/centos-supervisor
(interactive)
docker run -d million12/centos-supervisor
(detached, non-interactive)
docker build --tag=million12/centos-supervisor
Author: Marcin Ryzycki ([email protected])
Author: Przemyslaw Ozgo ([email protected])
This work is also inspired by maxexcloo's work on his docker images. Thanks!