forked from dbhavnakhatri/BreastCancerDetect_finalcodee
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.prod.yml
More file actions
78 lines (73 loc) · 2 KB
/
docker-compose.prod.yml
File metadata and controls
78 lines (73 loc) · 2 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
version: '3.8'
services:
# PostgreSQL Database
db:
image: postgres:15-alpine
container_name: breast-cancer-db
restart: always
environment:
- POSTGRES_USER=${DB_USER:-bcuser}
- POSTGRES_PASSWORD=${DB_PASSWORD:-bcpassword123}
- POSTGRES_DB=${DB_NAME:-breast_cancer_db}
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-bcuser} -d ${DB_NAME:-breast_cancer_db}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- breast-cancer-network
# Backend Service - FastAPI
backend:
image: ${DOCKER_USERNAME}/breast-cancer-backend:latest
container_name: breast-cancer-backend
restart: always
ports:
- "8001:8001"
environment:
- PYTHONUNBUFFERED=1
- MODEL_PATH=/app/models/breast_cancer_model.keras
- DATABASE_URL=postgresql://${DB_USER:-bcuser}:${DB_PASSWORD:-bcpassword123}@db:5432/${DB_NAME:-breast_cancer_db}
- SECRET_KEY=${SECRET_KEY:-your-super-secret-key-change-in-production}
volumes:
- /home/ubuntu/models:/app/models
depends_on:
db:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8001/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
networks:
- breast-cancer-network
# Frontend Service - React
frontend:
image: ${DOCKER_USERNAME}/breast-cancer-frontend:latest
container_name: breast-cancer-frontend
restart: always
ports:
- "3001:3001"
environment:
- REACT_APP_API_BASE_URL=${API_BASE_URL:-http://localhost:8001}
- PORT=3001
depends_on:
- backend
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3001"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
networks:
- breast-cancer-network
networks:
breast-cancer-network:
driver: bridge
volumes:
postgres_data:
driver: local