58 lines
1.4 KiB
YAML
58 lines
1.4 KiB
YAML
version: '3.8'
|
|
|
|
# تنظیمات پایه مشترک برای تمام سرویسها
|
|
x-app: &app
|
|
build: .
|
|
image: khatibi-app:latest
|
|
env_file: production.env
|
|
volumes:
|
|
- khatibi-sqlite-db:/app/sqlite:rw
|
|
restart: unless-stopped
|
|
networks:
|
|
- coolify
|
|
|
|
services:
|
|
web:
|
|
<<: *app
|
|
# در صورت استفاده از دامنه و پروکسی Coolify از expose استفاده کنید:
|
|
expose:
|
|
- "8000"
|
|
# اگر مایلید پورت مستقیماً روی سرور باز شود، خط بالا را کامنت کرده و دو خط زیر را فعال کنید:
|
|
# ports:
|
|
# - "8000:8000"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "python -c \"import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/').read()\""]
|
|
interval: 15s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 30s
|
|
|
|
worker:
|
|
<<: *app
|
|
command: ["python", "manage.py", "sms_worker", "--sleep", "3"]
|
|
depends_on:
|
|
web:
|
|
condition: service_healthy
|
|
|
|
scheduler:
|
|
<<: *app
|
|
command: ["python", "manage.py", "sms_scan", "--loop", "--interval", "300"]
|
|
depends_on:
|
|
web:
|
|
condition: service_healthy
|
|
|
|
delivery:
|
|
<<: *app
|
|
command: ["python", "manage.py", "sms_delivery", "--sleep", "30"]
|
|
depends_on:
|
|
web:
|
|
condition: service_healthy
|
|
|
|
volumes:
|
|
khatibi-sqlite-db:
|
|
external: true
|
|
name: tu9bnt8x4cd0hsmn8x6r5arf-khatibi-sqlite-db
|
|
|
|
networks:
|
|
coolify:
|
|
external: true |