Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
102 lines (95 loc) · 2.22 KB
/
Copy pathdocker-compose.yml
File metadata and controls
102 lines (95 loc) · 2.22 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
# Docker Compose for CashNet development and testing
# Includes: API server, Model server, Frontend, Database (optional)
version: '3.8'
services:
# API Backend
api:
build:
context: ./artifacts/api-server
dockerfile: Dockerfile
ports:
- "3000:3000"
environment:
NODE_ENV: development
PORT: 3000
PYTHON_SERVICE_URL: http://models:5000
ENABLE_PII_MASKING: "true"
LOG_MASKED_FIELDS: "false"
depends_on:
- models
networks:
- cashnet
restart: unless-stopped
volumes:
- ./artifacts/api-server/src:/app/src:ro
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/api/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 5s
# ML Model Server
models:
build:
context: .
dockerfile: scripts/Dockerfile.model-server
ports:
- "5000:5000"
environment:
FLASK_ENV: development
FLASK_DEBUG: "1"
PORT: 5000
PYTHONUNBUFFERED: "1"
volumes:
- ./models:/app/models
- ./lib:/app/lib:ro
- ./scripts/model_server.py:/app/model_server.py:ro
networks:
- cashnet
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
# Frontend (React)
frontend:
build:
context: ./artifacts/cashnet
dockerfile: Dockerfile
ports:
- "80:3000"
environment:
REACT_APP_API_URL: http://localhost:3000/api
REACT_APP_MODELS_URL: http://localhost:5000
depends_on:
- api
networks:
- cashnet
restart: unless-stopped
# PostgreSQL Database (optional)
database:
image: postgres:15-alpine
ports:
- "5432:5432"
environment:
POSTGRES_DB: cashnet
POSTGRES_USER: cashnet_user
POSTGRES_PASSWORD: cashnet_password_dev
volumes:
- cashnet_db:/var/lib/postgresql/data
networks:
- cashnet
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U cashnet_user"]
interval: 10s
timeout: 5s
retries: 5
networks:
cashnet:
driver: bridge
volumes:
cashnet_db:
driver: local