-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
69 lines (64 loc) · 1.85 KB
/
Copy pathdocker-compose.yml
File metadata and controls
69 lines (64 loc) · 1.85 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
version: '3.8'
services:
# 1. Database (PostgreSQL)
db:
image: postgres:15-alpine
container_name: fraudshield-db
environment:
- POSTGRES_USER=admin
- POSTGRES_PASSWORD=secret-db-password
- POSTGRES_DB=fraudshield
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
# 2. Prediction API (Production Optimized)
api:
build: .
container_name: fraudshield-api
ports:
- "8000:8000"
environment:
- FRAUD_API_KEY=fraud-detection-secret-key
- MLFLOW_TRACKING_URI=http://mlflow:5000
- DATABASE_URL=postgresql://admin:secret-db-password@db:5432/fraudshield
volumes:
- .:/app
command: gunicorn src.serve_validated:app -w 4 -k uvicorn.workers.UvicornWorker -b 0.0.0.0:8000 --timeout 120
depends_on:
- db
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
# 3. Management Dashboard
dashboard:
build: .
container_name: fraudshield-dashboard
ports:
- "8501:8501"
environment:
- MLFLOW_TRACKING_URI=http://mlflow:5000
- DATABASE_URL=postgresql://admin:secret-db-password@db:5432/fraudshield
volumes:
- .:/app
command: streamlit run src/dashboard.py --server.port 8501 --server.address 0.0.0.0
depends_on:
api:
condition: service_healthy
# 4. MLflow Tracking Server
mlflow:
build: .
container_name: fraudshield-mlflow
ports:
- "5000:5000"
environment:
- DATABASE_URL=postgresql://admin:secret-db-password@db:5432/fraudshield
volumes:
- .:/app
command: mlflow server --host 0.0.0.0 --port 5000 --backend-store-uri postgresql://admin:secret-db-password@db:5432/fraudshield --default-artifact-root /app/mlruns
depends_on:
- db
volumes:
postgres_data: