Sebastian Vîrlan Sebastian Vîrlan -4 years ago 78
Linux Question

Multiple services to run on a container or multiple containers Docker?

I have a container with a Laravel application that is used for development.

So I don't use an apache image, only a php 5.6 one. The process that keeps the container alive from not stopping is

php artisan serve --host=0.0.0.0


and this is also the command that start start the Laravel application server.
The application folder is mounted locally on my computer.

For my project I also need to run in my app root folder:

gulp watch
php artisan run:command
php artisan command:runServer 8282


So where and how can I run those commands? Should I create container for each command?

Answer Source

there is no definite answer, you can run several process in a container, using supervisor

https://docs.docker.com/engine/admin/using_supervisord/

or s6

https://blog.tutum.co/2014/12/02/docker-and-s6-my-new-favorite-process-supervisor/

or any other process manager (https://github.com/garywiz/chaperone-docker, http://blog.zakame.net/2013/12/docker-and-daemontools-best-buddies.html...)

You can have several containers working together

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download