-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
89 lines (84 loc) · 2.25 KB
/
docker-compose.yml
File metadata and controls
89 lines (84 loc) · 2.25 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
version: '3.9'
services:
# PostgreSQL Database
postgres:
image: postgres:16-alpine
container_name: insurance-fraud-postgres
environment:
POSTGRES_USER: ${DB_USER:-fraud_user}
POSTGRES_PASSWORD: ${DB_PASSWORD:-fraud_password}
POSTGRES_DB: ${DB_NAME:-insurance_fraud}
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-fraud_user}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- fraud-detection
restart: unless-stopped
# Backend Service
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: insurance-fraud-backend
environment:
DATABASE_URL: postgresql://${DB_USER:-fraud_user}:${DB_PASSWORD:-fraud_password}@postgres:5432/${DB_NAME:-insurance_fraud}
SECRET_KEY: ${SECRET_KEY:-your-secret-key-change-in-production}
DEBUG: ${DEBUG:-True}
ALLOWED_ORIGINS: http://localhost:5173,http://localhost:3000,http://frontend:80
MODELS_PATH: ./models
OTP_EXPIRY_MINUTES: 5
OTP_LENGTH: 6
RISK_LOW_THRESHOLD: 0.35
RISK_HIGH_THRESHOLD: 0.65
FRAUD_PROBABILITY_THRESHOLD: 0.5
FRAUD_HIGH_CONFIDENCE_THRESHOLD: 0.7
ports:
- "8000:8000"
depends_on:
postgres:
condition: service_healthy
volumes:
- ./backend/app:/app/app
- ./backend/models:/app/models
networks:
- fraud-detection
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# Frontend Service
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: insurance-fraud-frontend
ports:
- "5173:80"
environment:
- VITE_API_BASE_URL=http://localhost:8000
depends_on:
- backend
networks:
- fraud-detection
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 5s
networks:
fraud-detection:
driver: bridge
volumes:
postgres_data:
driver: local