Created
July 20, 2021 07:40
-
-
Save akkuman/5bb88dd4ca327aba657451edad1868a6 to your computer and use it in GitHub Desktop.
[supervisor django celery样例] #python #supervisor #celery
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[unix_http_server] | |
file=/var/run/supervisor.sock ; (the path to the socket file) | |
[supervisorctl] | |
serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket | |
[supervisord] | |
nodaemon=true | |
pidfile=/var/run/supervisord.pid | |
logfile=/var/log/supervisord.log | |
[rpcinterface:supervisor] | |
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface | |
[program:nginx] | |
command=/usr/sbin/nginx -g "daemon off;" | |
autorestart=true | |
startretries=5 | |
stopasgroup=true | |
killasgroup=true | |
[program:peien] | |
directory=/app | |
command=uwsgi --ini uwsgi.ini | |
autorestart=true | |
startretries=5 | |
redirect_stderr=true | |
stdout_logfile=/var/log/peien.log | |
environment = TZ='Asia/Shanghai',DJANGO_SETTINGS_MODULE=anstrategy.settings.production,APP_DIR=/app | |
stopasgroup=true | |
killasgroup=true | |
[program:subscriber] | |
directory=/app | |
command=python3 manage.py subscriber | |
autorestart=true | |
startretries=5 | |
redirect_stderr=true | |
stdout_logfile=/var/log/subscriber.log | |
environment = TZ='Asia/Shanghai',DJANGO_SETTINGS_MODULE=anstrategy.settings.production | |
stopasgroup=true | |
killasgroup=true | |
[program:celery_worker] | |
directory=/app | |
command=python3 -m celery -A anstrategy worker -l INFO -Q peiencelery -B | |
autorestart=true | |
startretries=5 | |
redirect_stderr=true | |
stdout_logfile=/var/log/celery_worker.log | |
environment = TZ='Asia/Shanghai',DJANGO_SETTINGS_MODULE=anstrategy.settings.production,DJANGO_IN_CELERY=true | |
stopasgroup=true | |
killasgroup=true | |
[program:promtail] | |
directory=/app | |
command=/app/bin/promtail-linux-amd64 -config.file /app/config/promtail-config.yml -config.expand-env=true | |
autorestart=true | |
startretries=5 | |
redirect_stderr=true | |
stdout_logfile=/var/log/promtail.log | |
environment = TZ='Asia/Shanghai',LOG_PATH='/app/logs/*.log',LOKI_URL=%(ENV_LOKI_URL)s,LOKI_USER=%(ENV_LOKI_USER)s,LOKI_PASS=%(ENV_LOKI_PASS)s,HOST=%(ENV_HOST)s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment