-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
106 lines (100 loc) · 2.74 KB
/
Copy pathdocker-compose.prod.yml
File metadata and controls
106 lines (100 loc) · 2.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
version: '3.8'
services:
# PostgreSQL Database
postgres:
image: postgres:15-alpine
container_name: pulmoscan-postgres-prod
environment:
POSTGRES_USER: pulmoscan
POSTGRES_PASSWORD: pulmoscan_password
POSTGRES_DB: pulmoscan
volumes:
- postgres_data_prod:/var/lib/postgresql/data
restart: always
healthcheck:
test: ["CMD-SHELL", "pg_isready -U pulmoscan"]
interval: 5s
timeout: 5s
retries: 5
# Redis Cache & Broker
redis:
image: redis:7-alpine
container_name: pulmoscan-redis-prod
volumes:
- redis_data_prod:/data
restart: always
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
# MinIO Object Storage (Self-hosted S3)
minio:
image: minio/minio
container_name: pulmoscan-minio-prod
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
command: server /data --console-address ":9001"
ports:
- "9000:9000"
- "9001:9001"
volumes:
- minio_data_prod:/data
restart: always
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
# Web API
web:
build:
context: .
dockerfile: Dockerfile
container_name: pulmoscan-api-prod
command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --workers 4
ports:
- "8000:8000"
environment:
- DATABASE_URL=postgresql://pulmoscan:pulmoscan_password@postgres:5432/pulmoscan
- REDIS_URL=redis://redis:6379/0
- MINIO_ENDPOINT=minio:9000
- MINIO_ACCESS_KEY=minioadmin
- MINIO_SECRET_KEY=minioadmin
- MINIO_BUCKET=pulmoscan-images
- MODEL_PATH=models/covid/mobilenetv3.onnx # Use ONNX model in prod
- CACHE_ENABLED=True
- DEBUG=False
depends_on:
- postgres
- redis
- minio
restart: always
# Celery Worker
worker:
build:
context: .
dockerfile: Dockerfile
container_name: pulmoscan-worker-prod
# Use prefork pool on Linux/Docker for true parallelism
command: celery -A app.workers.celery_app worker --loglevel=info --concurrency=4
environment:
- DATABASE_URL=postgresql://pulmoscan:pulmoscan_password@postgres:5432/pulmoscan
- REDIS_URL=redis://redis:6379/0
- MINIO_ENDPOINT=minio:9000
- MINIO_ACCESS_KEY=minioadmin
- MINIO_SECRET_KEY=minioadmin
- MINIO_BUCKET=pulmoscan-images
- MODEL_PATH=models/covid/mobilenetv3.onnx # Use ONNX model in prod
- CACHE_ENABLED=True
- DEBUG=False
depends_on:
- postgres
- redis
- minio
restart: always
volumes:
postgres_data_prod:
redis_data_prod:
minio_data_prod: