exaco / laravel-octane-dockerfile

Production-ready Dockerfile for Laravel Octane (FrankenPHP, Swoole, RoadRunner) powered web services and microservices. Done right.
MIT License
621 stars 93 forks source link

Why you using supervisor? #17

Closed Dezinger closed 2 years ago

Dezinger commented 2 years ago

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?

smortexa commented 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.

Dezinger commented 2 years ago

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."

smortexa commented 2 years ago

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.