请教各位大佬
1
OceanBreeze 360 天前 via iPhone
监听 -> 守护吧。supervisord 也完全可以在容器内运行,楼主有什么问题?
|
2
lzj307077687 360 天前 via iPhone
我的 supervisord 是用 docker exec
|
3
poisedflw 360 天前
CMD ["/usr/bin/supervisord", "--nodaemon", "--configuration", "/etc/supervisor/supervisord.conf"]
|
5
hongfs 359 天前
尝试下 pm2 ?
|
6
hefish 359 天前
用 supervisord 来启动 nginx 和 php-fpm 吧。 至少我是这么干的。 楼上有大佬说 pm2 ,嗯,得空去研究一下。
|
7
darklost 359 天前
开个容器专门跑 supervisord php-worker
|
8
pota 359 天前
单独用一个容器使用 supervisord 去守护 cli
|
9
brader 359 天前
大概就是这样子弄:
api_dockerfile: ``` FROM my_php COPY ./ /app WORKDIR /app COPY ./docker/php-fpm/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh RUN rm -rf /app/docker \ && chmod +x /usr/local/bin/docker-entrypoint.sh ENTRYPOINT ["docker-entrypoint.sh"] CMD ["php-fpm"] ``` docker-entrypoint.sh: ``` #!/bin/sh composer install php artisan storage:link php artisan migrate php artisan make:lang-json chown -R www-data:www-data lang/ storage/ service supervisor start supervisorctl reread supervisorctl update supervisorctl start laravel-worker:* exec docker-php-entrypoint "$@" ``` laravel-worker.conf: ``` [program:laravel-worker] process_name=%(program_name)s_%(process_num)02d command=php /app/artisan queue:work --sleep=2 --tries=3 --max-time=3600 autostart=true autorestart=true stopasgroup=true killasgroup=true user=www-data numprocs=2 redirect_stderr=true stdout_logfile=/root/laravel-worker.log stopwaitsecs=3600 ``` |