Closed Dezinger closed 2 years ago
To manage multiple processes such as Horizon, Scheduler, or any other scripts alongside Octane command in some container modes, we need to use a process manager like supervisord
. If the Octane is a single main process, Docker can probably be used to start it. However, in cases like queue:work
, we still need to use Supervisor.
The official OpenSwoole/Swoole Docker images also use Supervisor to manage Swoole processes.
It break the concept one servicer per contaiter. And may make trouble, for example when second service will always down you d't know about. Just used another container.
https://docs.docker.com/config/containers/multi-service_container/ "It’s ok to have multiple processes, but to get the most benefit out of Docker, avoid one container being responsible for multiple aspects of your overall application."
Yeap, but sometimes we need something that doesn't follow the best practice. If you want to have the Horizon dashboard in a queue container, so an HTTP server process is required.
Using supervisor in container as main process is bad practice. It req additional resources, it useless mediator via our app. Why you not used only octane?