-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
72 lines (68 loc) · 2.42 KB
/
Copy pathdocker-compose.yml
File metadata and controls
72 lines (68 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
services:
# ── Infrastructure ────────────────────────────────────────────────────────
redis:
image: redis:7-alpine
# No host port — only the api container needs this, over the Docker network
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
timescaledb:
image: timescale/timescaledb:latest-pg16
# No host port — only the api container needs this, over the Docker network
environment:
POSTGRES_USER: ${DB_USER:-sentinel}
POSTGRES_PASSWORD: ${DB_PASSWORD:-sentinel}
POSTGRES_DB: ${DB_NAME:-sentinel}
volumes:
- timescale_data:/var/lib/postgresql/data
- ./infra/init_db.sql:/docker-entrypoint-initdb.d/init.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-sentinel}"]
interval: 5s
timeout: 3s
retries: 10
# ── API server ────────────────────────────────────────────────────────────
api:
build:
context: .
dockerfile: Dockerfile
ports:
- "127.0.0.1:8000:8000" # localhost only — Nginx proxies inbound traffic
environment:
DB_HOST: timescaledb
DB_PORT: 5432
DB_USER: ${DB_USER:-sentinel}
DB_PASSWORD: ${DB_PASSWORD:-sentinel}
DB_NAME: ${DB_NAME:-sentinel}
REDIS_HOST: redis
REDIS_PORT: 6379
volumes:
- ./artifacts:/app/artifacts
- hf_cache:/cache/huggingface
depends_on:
timescaledb:
condition: service_healthy
redis:
condition: service_healthy
restart: unless-stopped
# ── Next.js dashboard ─────────────────────────────────────────────────────
dashboard:
build:
context: ./dashboard
dockerfile: Dockerfile
args:
# Full base URL of the API — baked into the JS bundle at build time
NEXT_PUBLIC_API_BASE: ${API_BASE:-http://localhost:8000}
ports:
- "127.0.0.1:3000:3000" # localhost only — Nginx proxies inbound traffic
depends_on:
- api
restart: unless-stopped
volumes:
redis_data:
timescale_data:
hf_cache: