feat(server): main.go assemblage complet + Docker + Nginx
- Assemble tous les packages (config, db, handlers, transport, websocket, prometheus) - Boucle de rétention et détection offline toutes les minutes - Routage REST /api/agents/, /api/config, /metrics, /ws - Dockerfile multi-stage CGO_ENABLED=0 (alpine:3.19) - docker-compose.yml avec service server + dashboard Nginx - nginx.conf avec proxy WebSocket et fallback SPA Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
version: '3.8'
|
||||
services:
|
||||
server:
|
||||
build: .
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
UDP_ADDR: "0.0.0.0:9999"
|
||||
DB_PATH: "/data/nanometrics.db"
|
||||
HTTP_ADDR: "0.0.0.0:8080"
|
||||
MQTT_BROKER: "tcp://10.0.0.3:1883"
|
||||
MQTT_TOPIC_BASE: "nanometrics/agents"
|
||||
volumes:
|
||||
- nanometrics_data:/data
|
||||
ports:
|
||||
- "9999:9999/udp"
|
||||
|
||||
dashboard:
|
||||
image: nginx:alpine
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf:ro
|
||||
- ../dashboard:/usr/share/nginx/html:ro
|
||||
ports:
|
||||
- "80:80"
|
||||
depends_on:
|
||||
- server
|
||||
|
||||
volumes:
|
||||
nanometrics_data:
|
||||
Reference in New Issue
Block a user