43 lines
1.2 KiB
YAML
43 lines
1.2 KiB
YAML
services:
|
|
fastapi:
|
|
image: your-registry/fastapi-app:latest
|
|
container_name: fastapi_app
|
|
command: uvicorn app.main:app --host 0.0.0.0 --port 7890
|
|
ports:
|
|
- "7890:7890"
|
|
env_file:
|
|
- .env.prod
|
|
environment:
|
|
- MAIN_SERVER_URL=${MAIN_SERVER_URL} # 예: https://api.example.com
|
|
- CELERY_BROKER_URL=${CELERY_BROKER_URL}
|
|
- CELERY_RESULT_BACKEND=${CELERY_RESULT_BACKEND}
|
|
volumes:
|
|
- ./temp_files:/app/temp_files
|
|
restart: unless-stopped
|
|
depends_on:
|
|
- redis
|
|
|
|
# 운영에서 Flower/Beat를 같은 호스트에 둘 필요가 없다면 제외 가능
|
|
flower:
|
|
image: your-registry/fastapi-app:latest
|
|
container_name: flower_monitor
|
|
command: celery -A app.celery_worker flower --port=5555
|
|
ports:
|
|
- "5555:5555"
|
|
env_file:
|
|
- .env.prod
|
|
environment:
|
|
- FLOWER_UNAUTHENTICATED_API=true
|
|
- CELERY_BROKER_URL=${CELERY_BROKER_URL}
|
|
- CELERY_RESULT_BACKEND=${CELERY_RESULT_BACKEND}
|
|
restart: unless-stopped
|
|
depends_on:
|
|
- redis
|
|
|
|
redis:
|
|
image: redis:6.2
|
|
container_name: redis_server
|
|
ports:
|
|
- "6379:6379"
|
|
command: ["redis-server", "--appendonly", "yes"]
|
|
restart: unless-stopped |