-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose-civwatch.yml
More file actions
109 lines (102 loc) · 3.27 KB
/
docker-compose-civwatch.yml
File metadata and controls
109 lines (102 loc) · 3.27 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
103
104
105
106
107
108
109
# CIVWATCH — Local Development Stack
# Node.js API (3000) + Vite React (4000) + FastAPI ML (5000) + PostgreSQL (5432)
#
# Quick start:
# cp .env.example .env
# docker-compose -f docker-compose-civwatch.yml up -d --build
#
# Dashboard: http://localhost:4000
# API: http://localhost:3000
# ML docs: http://localhost:5000/docs
# DB: localhost:5432 user=postgres db=civwatch
services:
# ── PostgreSQL ──────────────────────────────────────────────────────────────
db:
image: postgres:15-alpine
container_name: civwatch-db
restart: unless-stopped
ports:
- "5432:5432"
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${DB_PASSWORD:-postgres}
POSTGRES_DB: civwatch
volumes:
- pgdata:/var/lib/postgresql/data
- ./backend/migrations:/docker-entrypoint-initdb.d:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d civwatch"]
interval: 10s
timeout: 5s
retries: 5
start_period: 20s
networks:
- civwatch
# ── Node.js Backend ─────────────────────────────────────────────────────────
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: civwatch-backend
restart: unless-stopped
ports:
- "3000:3000"
environment:
DATABASE_URL: postgresql://postgres:${DB_PASSWORD:-postgres}@db:5432/civwatch
ML_SERVICE_URL: http://ml:5000
NODE_ENV: development
PORT: 3000
JWT_SECRET: ${JWT_SECRET:-civwatch_dev_secret_change_in_prod}
depends_on:
db:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost:3000/health || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
networks:
- civwatch
# ── FastAPI ML Service ──────────────────────────────────────────────────────
ml:
build:
context: ./ml
dockerfile: Dockerfile
container_name: civwatch-ml
restart: unless-stopped
ports:
- "5000:5000"
environment:
CORS_ORIGINS: http://localhost:4000,http://frontend:4000
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost:5000/health || exit 1"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
networks:
- civwatch
# ── Vite React Frontend ─────────────────────────────────────────────────────
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: civwatch-frontend
restart: unless-stopped
ports:
- "4000:4000"
environment:
VITE_API_URL: http://localhost:3000
VITE_ML_URL: http://localhost:5000
depends_on:
backend:
condition: service_healthy
networks:
- civwatch
networks:
civwatch:
driver: bridge
volumes:
pgdata:
driver: local