2024-01-06 12:13:39 +08:00
|
|
|
version: "3.9"
|
|
|
|
|
|
|
|
services:
|
2024-05-10 23:15:29 +08:00
|
|
|
# Django Backend
|
|
|
|
django:
|
|
|
|
env_file: .env
|
2024-08-30 21:34:01 +08:00
|
|
|
image: git.keannu1.duckdns.org/keannu125/drf_template:latest
|
2024-01-06 12:13:39 +08:00
|
|
|
ports:
|
2024-08-30 16:52:15 +08:00
|
|
|
- "${BACKEND_PORT}:${BACKEND_PORT}"
|
2024-01-06 12:13:39 +08:00
|
|
|
environment:
|
|
|
|
- PYTHONBUFFERED=1
|
2024-05-10 23:15:29 +08:00
|
|
|
- RUN_TYPE=web
|
2024-01-06 12:13:39 +08:00
|
|
|
volumes:
|
2024-05-10 23:15:29 +08:00
|
|
|
- .:/code
|
|
|
|
depends_on:
|
|
|
|
- postgres
|
|
|
|
|
|
|
|
# Django Celery Worker
|
|
|
|
celery:
|
|
|
|
env_file: .env
|
|
|
|
environment:
|
|
|
|
- RUN_TYPE=worker
|
2024-08-30 21:34:01 +08:00
|
|
|
image: git.keannu1.duckdns.org/keannu125/drf_template:latest
|
2024-05-10 23:15:29 +08:00
|
|
|
volumes:
|
|
|
|
- .:/code
|
|
|
|
- ./chrome:/chrome
|
|
|
|
- ./firefox:/firefox
|
|
|
|
- ./dumps:/dumps
|
|
|
|
depends_on:
|
|
|
|
- django
|
|
|
|
- postgres
|
|
|
|
- redis
|
|
|
|
## Runs multiple worker instances
|
|
|
|
scale: 4
|
|
|
|
|
|
|
|
# Django Celery Beat
|
|
|
|
celery_beat:
|
|
|
|
env_file: .env
|
|
|
|
environment:
|
|
|
|
- RUN_TYPE=beat
|
2024-08-30 21:34:01 +08:00
|
|
|
image: git.keannu1.duckdns.org/keannu125/drf_template:latest
|
2024-05-10 23:15:29 +08:00
|
|
|
volumes:
|
|
|
|
- .:/code
|
|
|
|
depends_on:
|
|
|
|
- celery
|
|
|
|
- django
|
|
|
|
- postgres
|
|
|
|
- redis
|
|
|
|
|
|
|
|
# SQL Database
|
|
|
|
postgres:
|
|
|
|
env_file: .env
|
|
|
|
image: postgres
|
|
|
|
environment:
|
|
|
|
- POSTGRES_DB=${DB_DATABASE}
|
|
|
|
- POSTGRES_USER=${DB_USERNAME}
|
|
|
|
- POSTGRES_PASSWORD=${DB_PASSWORD}
|
|
|
|
ports:
|
|
|
|
- "${DB_PORT}:5432"
|
|
|
|
volumes:
|
|
|
|
- db-data:/var/lib/postgresql/data
|
|
|
|
|
|
|
|
# Redis Server
|
|
|
|
redis:
|
|
|
|
image: redis:latest
|
|
|
|
ports:
|
|
|
|
- "${REDIS_PORT}:6379"
|
|
|
|
|
|
|
|
# Stripe CLI Webhook Listener
|
|
|
|
stripe-listener:
|
|
|
|
env_file: .env
|
|
|
|
image: stripe/stripe-cli:latest
|
|
|
|
environment:
|
|
|
|
- STRIPE_WEBHOOK_SECRET=${STRIPE_SECRET_WEBHOOK}
|
|
|
|
- STRIPE_API_KEY=${STRIPE_SECRET_KEY}
|
|
|
|
command: listen --forward-to django:8000/api/v1/stripe/webhook/
|
|
|
|
|
2024-01-06 12:13:39 +08:00
|
|
|
volumes:
|
2024-05-10 23:15:29 +08:00
|
|
|
db-data:
|