fix supervirod

This commit is contained in:
javad committed 2026-06-16 12:15:08 +03:30
1 parent f7c6e32f96
commit ff99632c0a
1 file changed
+4 -6
+4 -6
View File
@@ -2,12 +2,10 @@
nodaemon=true nodaemon=true
logfile=/dev/null logfile=/dev/null
pidfile=/tmp/supervisord.pid pidfile=/tmp/supervisord.pid
# 🛠️ اصلاح ۱: تعریف دایرکتوری مجاز برای لاگ‌های داخلی سوپروایزر
childlogdir=/tmp childlogdir=/tmp
[unix_http_server] [unix_http_server]
file=/tmp/supervisor.sock file=/tmp/supervisor.sock
# 🛠️ اصلاح ۲: افزایش سطح دسترسی سوکت برای کاربر مالک فرآیند
chmod=0770 chmod=0770
[rpcinterface:supervisor] [rpcinterface:supervisor]
@@ -17,9 +15,9 @@ supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
serverurl=unix:///tmp/supervisor.sock serverurl=unix:///tmp/supervisor.sock
[program:django-web] [program:django-web]
command=gunicorn config.wsgi:application --bind 0.0.0.0:8000 --workers 3 # 🛠️ اصلاح اصلی: آدرس‌دهی مستقیم به gunicorn موجود در محیط مجازی (Virtual Environment)
command=/opt/venv/bin/gunicorn config.wsgi:application --bind 0.0.0.0:8000 --workers 3
directory=/app directory=/app
# 🛠️ اصلاح ۳: مشخص کردن صریح کاربر اجراکننده
user=django user=django
autostart=true autostart=true
autorestart=true autorestart=true
@@ -29,9 +27,9 @@ stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0 stderr_logfile_maxbytes=0
[program:celery-worker] [program:celery-worker]
command=celery -A config worker -l INFO # برای محکم‌کاری، آدرس سلری را هم به فایل اصلی ونیو متصل می‌کنیم
command=/opt/venv/bin/celery -A config worker -l INFO
directory=/app directory=/app
# 🛠️ اصلاح ۳: مشخص کردن صریح کاربر اجراکننده
user=django user=django
autostart=true autostart=true
autorestart=true autorestart=true