-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
72 lines (69 loc) · 2.33 KB
/
Copy pathdocker-compose.yml
File metadata and controls
72 lines (69 loc) · 2.33 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:
# ── MQTT Broker ──────────────────────────────────────
mosquitto:
image: eclipse-mosquitto:2
container_name: thesis-mosquitto
ports:
- "1883:1883" # MQTT
- "9001:9001" # WebSocket (for dashboard)
volumes:
- ./mosquitto/mosquitto.conf:/mosquitto/config/mosquitto.conf
- mosquitto_data:/mosquitto/data
- mosquitto_log:/mosquitto/log
healthcheck:
test: ["CMD-SHELL", "mosquitto_sub -t '$$SYS/#' -C 1 -W 3 || exit 1"]
interval: 10s
timeout: 5s
retries: 3
restart: unless-stopped
# ── FastAPI Server ───────────────────────────────────
server:
build:
context: ./server
dockerfile: Dockerfile
container_name: thesis-server
ports:
- "8000:8000"
env_file:
- ./server/.env
environment:
- MQTT_BROKER_HOST=mosquitto
- MQTT_BROKER_PORT=1883
- DATABASE_URL=sqlite+aiosqlite:///./data/thesis.db
- VLLM_BASE_URL=http://host.docker.internal:8001/v1
- TZ=Europe/Brussels
volumes:
- ./server/app:/app/app # Hot reload in dev
- server_data:/app/data # Persistent DB + uploads
depends_on:
mosquitto:
condition: service_healthy
healthcheck:
test: ["CMD", "python", "-c", "import httpx; r = httpx.get('http://localhost:8000/health'); r.raise_for_status()"]
interval: 15s
timeout: 5s
retries: 3
start_period: 10s
restart: unless-stopped
# ── Next.js Dashboard ───────────────────────────────
dashboard:
build:
context: ./dashboard
dockerfile: Dockerfile
args:
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL:-http://localhost:8000}
- NEXT_PUBLIC_MQTT_WS_URL=${NEXT_PUBLIC_MQTT_WS_URL:-ws://localhost:9001}
container_name: thesis-dashboard
ports:
- "80:3000"
environment:
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL:-http://localhost:8000}
- NEXT_PUBLIC_MQTT_WS_URL=${NEXT_PUBLIC_MQTT_WS_URL:-ws://localhost:9001}
depends_on:
- server
- mosquitto
restart: unless-stopped
volumes:
mosquitto_data:
mosquitto_log:
server_data: