Is it possible to install a complex server inside

2019-05-18 14:59发布

问题:

It appears that Docker is better suited for single process applications and services, but is it capable to offer a stable containment for a more complex application ( that has multiple processes, listening ports, considerable storage usage ) ?

回答1:

Yes! You can use Supervisor, monit, runit, or even a "real" init system (including upstart or systemd) to run multiple processes. You can even use a cheap shell script like the following:

#!/bin/sh
( while true; do run-process-1; done; ) &
( while true; do run-process-2; done; ) &
wait


回答2:

Note that I have a supervisor image and some examples on github. In case someone thinks it usefull: I also wrote a blog on this.

I mainly use supervisor to keep deamon processes running, but you could create complex environments as well (e.g. specify the order to start processes etc.).



回答3:

Sure checkout http://supervisord.org/ i am creating complete LAMP stacks for Magento development.



标签: docker