sms
This commit is contained in:
1 parent
250cdbab7f
commit
5c6069c3ef
87 files changed
+29209
-3697
No files matched your search
@@ -0,0 +1,43 @@
|
||||
# راهاندازی چهار سرویس از یک ایمیج مشترک:
|
||||
# web → وبسرور Gunicorn (میگریشن/استاتیک فقط اینجا اجرا میشود)
|
||||
# worker → تخلیه صف پیامک (sms_worker)
|
||||
# scheduler → اسکن دورهای و صفکردن یادآوریها (sms_scan --loop)
|
||||
# delivery → استعلام وضعیت تحویل پیامکها (sms_delivery --sleep 30)
|
||||
#
|
||||
# توجه: دیتابیس SQLite است؛ مقیاس افقی (چند replica) ممنوع.
|
||||
x-app: &app
|
||||
build: .
|
||||
env_file: production.env
|
||||
volumes:
|
||||
- ./sqlite:/app/sqlite
|
||||
restart: unless-stopped
|
||||
|
||||
services:
|
||||
web:
|
||||
<<: *app
|
||||
ports:
|
||||
- "8000:8000"
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "python -c \"import urllib.request;urllib.request.urlopen('http://127.0.0.1:8000/').read()\""]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 5
|
||||
start_period: 60s
|
||||
|
||||
worker:
|
||||
<<: *app
|
||||
command: ["python", "manage.py", "sms_worker", "--sleep", "3"]
|
||||
depends_on:
|
||||
- web
|
||||
|
||||
scheduler:
|
||||
<<: *app
|
||||
command: ["python", "manage.py", "sms_scan", "--loop", "--interval", "300"]
|
||||
depends_on:
|
||||
- web
|
||||
|
||||
delivery:
|
||||
<<: *app
|
||||
command: ["python", "manage.py", "sms_delivery", "--sleep", "30"]
|
||||
depends_on:
|
||||
- web
|
||||
Reference in new issue
Block a user