-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
94 lines (89 loc) · 2.42 KB
/
docker-compose.yml
File metadata and controls
94 lines (89 loc) · 2.42 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
version: '3.8'
services:
# PostgreSQL Database
db:
image: postgres:15-alpine
container_name: breast-cancer-db
environment:
- POSTGRES_USER=bcuser
- POSTGRES_PASSWORD=bcpassword123
- POSTGRES_DB=breast_cancer_db
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U bcuser -d breast_cancer_db"]
interval: 10s
timeout: 5s
retries: 5
networks:
- breast-cancer-network
# Backend Service - FastAPI
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: breast-cancer-backend
ports:
- "8001:8001"
environment:
- PYTHONUNBUFFERED=1
- MODEL_PATH=/app/models/breast_cancer_model.keras
- DATABASE_URL=postgresql://bcuser:bcpassword123@db:5432/breast_cancer_db
- SECRET_KEY=your-super-secret-key-change-in-production-123456789
volumes:
- /home/ubuntu/models:/app/models
- ./backend/main.py:/app/main.py
- ./backend/grad_cam.py:/app/grad_cam.py
- ./backend/report_generator.py:/app/report_generator.py
- ./backend/yolo_detector.py:/app/yolo_detector.py
- ./backend/database.py:/app/database.py
- ./backend/schemas.py:/app/schemas.py
- ./backend/auth.py:/app/auth.py
- ./backend/api_routes.py:/app/api_routes.py
command: python -m uvicorn main:app --host 0.0.0.0 --port 8001 --reload
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:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: breast-cancer-frontend
ports:
- "3001:3001"
environment:
- REACT_APP_API_BASE_URL=http://18.191.185.246:8001
- PORT=3001
volumes:
- ./frontend:/app
- /app/node_modules
command: npm start
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3001"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
networks:
- breast-cancer-network
depends_on:
- backend
networks:
breast-cancer-network:
driver: bridge
volumes:
postgres_data:
driver: local
frontend_node_modules:
driver: local