-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
250 lines (227 loc) · 6.76 KB
/
docker-compose.yml
File metadata and controls
250 lines (227 loc) · 6.76 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
services:
# MQTT Message Bus - Central communication hub
mosquitto:
image: eclipse-mosquitto:2
container_name: homesight-mosquitto
ports:
- "1883:1883"
- "9001:9001"
volumes:
- ./docker/mosquitto/mosquitto.conf:/mosquitto/config/mosquitto.conf:ro
- mosquitto_data:/mosquitto/data
- mosquitto_log:/mosquitto/log
restart: unless-stopped
networks:
- homesight
# HomeSight Core API
api:
build:
context: .
dockerfile: docker/api/Dockerfile
image: homesight-api
container_name: homesight-api
ports:
- "8080:8080"
environment:
- HOMESIGHT_CONFIG=/app/config.yaml
# Docker networking - use service names instead of localhost
- MQTT_BROKER_URL=tcp://mosquitto:1883
- AI_SERVICE_URL=http://ai-sidecar:8001
- PROMETHEUS_URL=http://prometheus:9090
# ZwaveJS WebSocket API is on port 3000 inside the container
- ZWAVE_WEBSOCKET_URL=ws://zwavejs:3000
volumes:
- ./config.yaml:/app/config.yaml:ro
# All databases persisted in ./data directory
- ./data:/var/lib/homesight:rw
- /etc/localtime:/etc/localtime:ro
depends_on:
- mosquitto
- zwavejs
restart: unless-stopped
networks:
- homesight
# Allow container to reach host for zwavejs if needed
extra_hosts:
- "host.docker.internal:host-gateway"
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
prometheus:
image: prom/prometheus:latest
container_name: homesight-prometheus
ports:
- "9090:9090"
volumes:
- ./docker/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
restart: unless-stopped
networks:
- homesight
ai-sidecar:
build:
context: .
dockerfile: docker/ai-sidecar/Dockerfile
image: homesight-ai-sidecar
container_name: homesight-ai-sidecar
# GPU acceleration for AMD Radeon 780M (RDNA3 / gfx1103)
devices:
- "/dev/dri:/dev/dri"
- "/dev/kfd:/dev/kfd"
group_add:
- "44" # video group
- "993" # render group (for /dev/dri/renderD128 and /dev/kfd)
ports:
- "8001:8001"
env_file:
- .env
environment:
- TOKENIZERS_PARALLELISM=false
# Vulkan backend for llama-cpp-python
- GGML_VULKAN=1
- GGML_VULKAN_DEVICE=0
# AMD RDNA3 (Phoenix / gfx1103) compatibility
- HSA_OVERRIDE_GFX_VERSION=11.0.3
- AMD_VULKAN_ICD=RADV
- VK_LOADER_DEBUG=error
# Gunicorn worker configuration
# CRITICAL: Must be 1 for llama.cpp due to KV cache state conflicts
- GUNICORN_WORKERS=1
# Backend services
- BACKEND_URL=http://api:8080
- MQTT_BROKER_URL=tcp://mosquitto:1883
- HOMESIGHT_CONFIG=/etc/homesight/config.yaml
# API keys
- BRAVE_SEARCH_API_KEY=${BRAVE_SEARCH_API_KEY}
- BING_SEARCH_API_KEY=${BING_SEARCH_API_KEY}
- OPENAI_API_KEY=${OPENAI_API_KEY}
volumes:
- ./config.yaml:/etc/homesight/config.yaml:ro
- ./data/manuals:/root/homesight/manuals:rw
# Persist all databases in ./data directory
- ./data:/var/lib/homesight:rw
# Mount host models directory for Llama model
- /home/homesight/models:/home/homesight/models:rw
- /etc/localtime:/etc/localtime:ro
- /home/homesight/logs:/app/log:rw
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
labels: "ai-sidecar"
restart: unless-stopped
networks:
- homesight
depends_on:
- api
- mosquitto
# Allow container to reach host via host.docker.internal
extra_hosts:
- "host.docker.internal:host-gateway"
# To give access to host devices (USB / serial), add 'devices' entries here or mount them at runtime.
zwavejs:
image: zwavejs/zwave-js-ui:latest
container_name: homesight-zwavejs
restart: unless-stopped
# Map Z-Wave USB stick (use by-id for stability across reboots)
devices:
- /dev/serial/by-id/usb-Zooz_800_Z-Wave_Stick_533D004242-if00:/dev/zwave
volumes:
# Persistent storage for Z-Wave network state and NVM backups
- /var/lib/homesight/zwavejs:/usr/src/app/store
# Security keys (S2) - mounted read-only
- ./config/zwave-keys.json:/usr/src/app/store/keys.json:ro
environment:
- RATE_LIMIT_ENABLED=false
# Disable MQTT - we use WebSocket API directly
- MQTT_ENABLED=false
# Session secret for web UI (only needed if UI is enabled)
- SESSION_SECRET=${ZWAVE_SESSION_SECRET:-changeme-random-secret}
# Logging
- LOGTOFILE=true
- LOG_LEVEL=info
# Trust proxy headers (behind reverse proxy)
# (removed for local/dev; do not set to a string 'false' because
# that can be interpreted as truthy by the app)
# Timezone
- TZ=America/New_York
ports:
# WebSocket API - internal only (accessible from other containers)
- "127.0.0.1:3001:3000"
# Web UI - ONLY enable in development
# Uncomment for debugging/setup, comment out in production
- "127.0.0.1:8091:8091"
networks:
- homesight
# Health check
healthcheck:
test: [ "CMD", "wget", "--spider", "-q", "http://localhost:8091/health" ]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
# Resource limits for appliance
deploy:
resources:
limits:
memory: 512M
cpus: '1.0'
reservations:
memory: 256M
cpus: '0.5'
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
web-ui:
build:
context: .
dockerfile: docker/web-ui/Dockerfile
image: homesight-web-ui
container_name: homesight-web-ui
ports:
- "0.0.0.0:80:80"
depends_on:
- api
restart: unless-stopped
networks:
- homesight
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
grafana:
image: grafana/grafana:latest
container_name: homesight-grafana
ports:
- "3001:3000"
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin
volumes:
- grafana_data:/var/lib/grafana
- ./docker/grafana/provisioning:/etc/grafana/provisioning:ro
depends_on:
- prometheus
restart: unless-stopped
networks:
- homesight
volumes:
prometheus_data:
grafana_data:
zwavejs_data:
mosquitto_data:
mosquitto_log:
networks:
homesight:
driver: bridge