-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
47 lines (43 loc) · 1.08 KB
/
Copy pathdocker-compose.yml
File metadata and controls
47 lines (43 loc) · 1.08 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
services:
# React app served by nginx
frontend:
build: ./frontend
ports:
- "3000:80" # browser hits localhost:3000
volumes:
- ./frontend/public/models:/models # nginx alias /models/ → this dir
depends_on:
- backend
# FastAPI backend
backend:
build: ./backend
ports:
- "8000:8000" # browser API calls go to localhost:8000
env_file:
- .env
environment:
MODELS_DIR: /app/models
volumes:
- ./frontend/public/models:/app/models # same host dir as nginx above
- ./backend/artifacts:/app/artifacts # trained joblib files - available immediately
depends_on:
db:
condition: service_healthy
# PostgreSQL
db:
image: postgres:16
environment:
POSTGRES_DB: eco_init
POSTGRES_USER: postgres
POSTGRES_PASSWORD: 6196
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 10
ports:
- "5432:5432"
volumes:
pgdata: