-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
92 lines (85 loc) · 3.05 KB
/
Copy pathdocker-compose.yml
File metadata and controls
92 lines (85 loc) · 3.05 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
# docker-compose.yml — Development & local deployment
# For a specific release version, use docker-compose.release.yml (attached to GitHub Releases)
#
# Usage:
# Start: docker-compose up -d
# Logs: docker-compose logs -f
# Stop: docker-compose down
# Rebuild: docker-compose up -d --build
version: '3.8'
# ─── Shared configuration via YAML anchors ───────────────────────────────────
x-logging: &default-logging
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
x-restart: &default-restart
restart: unless-stopped
# ─── Services ────────────────────────────────────────────────────────────────
services:
backend:
build:
context: .
dockerfile: Dockerfile
args:
BUILD_DATE: ${BUILD_DATE:-unknown}
GIT_SHA: ${GIT_SHA:-unknown}
VERSION: ${VERSION:-dev}
image: prism-backend:local
container_name: prism-backend
<<: *default-restart
ports:
- "${BACKEND_PORT:-8000}:8000"
volumes:
# Persist data and models without embedding them in the image
- ./data:/app/data:ro # read-only — prevents accidental overwrites
- ./models:/app/models:ro
- ./reports:/app/reports # writable — API may write SHAP plots
environment:
- APP_VERSION=${VERSION:-dev}
# Add any future env vars here (e.g. database URL, API keys)
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/api/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s # give model loading time before first check
logging: *default-logging
networks:
- prism-net
frontend:
build:
context: ./dashboard
dockerfile: Dockerfile
args:
NEXT_PUBLIC_API_URL: http://localhost:8000
BUILD_DATE: ${BUILD_DATE:-unknown}
GIT_SHA: ${GIT_SHA:-unknown}
VERSION: ${VERSION:-dev}
image: prism-frontend:local
container_name: prism-frontend
<<: *default-restart
ports:
- "${FRONTEND_PORT:-3000}:3000"
environment:
# Browser makes API calls to localhost:8000 (host machine port)
# Use http://backend:8000 only for server-side calls within Docker
- NEXT_PUBLIC_API_URL=http://localhost:8000
- APP_VERSION=${VERSION:-dev}
depends_on:
backend:
condition: service_healthy # wait for backend health check to pass
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
logging: *default-logging
networks:
- prism-net
# ─── Networks ─────────────────────────────────────────────────────────────────
networks:
prism-net:
name: prism-network
driver: bridge