Complete IoT monitoring platform for Acuvim II power meters via ESP32. Firmware (Phases 1-7): - ESP32-WROVER-B (TTGO T-Call v1.4) with RS485 Modbus RTU - WiFi STA+AP concurrent mode with GSM/GPRS failover - Transport abstraction layer with 4 priority modes - MQTT protocol with 20 commands, LWT, QoS, exponential backoff - SD card offline buffering with JSONL rotation and non-blocking drain - OTA firmware updates with dual partition rollback protection - Watchdog timer, crash loop detection, Acuvim health monitoring - Captive portal provisioning with AP mode Console backend (Phase 8): - .NET 10 minimal API with PostgreSQL + EF Core - JWT authentication, SignalR real-time updates - MQTTnet 5.x bridge service with health monitoring - Device, telemetry, firmware, alert, group management - Rate limiting, security headers, Swagger/OpenAPI Frontend (Phase 9): - React 18 + TypeScript + Vite with Ant Design 5 - ECharts telemetry visualization, TanStack Query - SignalR live updates, device management UI - Dashboard, fleet management, firmware deployment Testing & Production (Phase 10): - 28 firmware unit tests (Modbus, JSON, config, version) - 23 xUnit backend tests (device, telemetry, command, alert) - Docker Compose with nginx, TLS MQTT, PostgreSQL - Production deployment, commissioning, and troubleshooting docs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
70 lines
1.6 KiB
YAML
70 lines
1.6 KiB
YAML
services:
|
|
console:
|
|
build: .
|
|
restart: unless-stopped
|
|
ports:
|
|
- "5000:5000"
|
|
environment:
|
|
- ASPNETCORE_ENVIRONMENT=Production
|
|
- ConnectionStrings__DefaultConnection=Host=db;Database=acuvim;Username=acuvim;Password=${POSTGRES_PASSWORD}
|
|
- Mqtt__Broker=mqtt
|
|
- Mqtt__Port=8883
|
|
- Mqtt__Username=console
|
|
- Mqtt__Password=${MQTT_PASSWORD}
|
|
- Mqtt__UseTls=true
|
|
- Firmware__BaseUrl=${CONSOLE_URL}
|
|
- Jwt__Secret=${JWT_SECRET}
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
mqtt:
|
|
condition: service_started
|
|
volumes:
|
|
- firmware-data:/app/firmware
|
|
|
|
db:
|
|
image: postgres:16
|
|
restart: unless-stopped
|
|
environment:
|
|
- POSTGRES_DB=acuvim
|
|
- POSTGRES_USER=acuvim
|
|
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
|
volumes:
|
|
- postgres-data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U acuvim"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
mqtt:
|
|
image: eclipse-mosquitto:2
|
|
restart: unless-stopped
|
|
ports:
|
|
- "8883:8883"
|
|
volumes:
|
|
- mosquitto-data:/mosquitto/data
|
|
- mosquitto-config:/mosquitto/config
|
|
- ./mosquitto-prod.conf:/mosquitto/config/mosquitto.conf
|
|
- ./mqtt-certs:/mosquitto/certs
|
|
- ./mqtt-passwords:/mosquitto/passwords
|
|
|
|
nginx:
|
|
image: nginx:alpine
|
|
restart: unless-stopped
|
|
ports:
|
|
- "443:443"
|
|
- "80:80"
|
|
volumes:
|
|
- ./nginx.conf:/etc/nginx/conf.d/default.conf
|
|
- ssl-certs:/etc/letsencrypt
|
|
depends_on:
|
|
- console
|
|
|
|
volumes:
|
|
postgres-data:
|
|
mosquitto-data:
|
|
mosquitto-config:
|
|
firmware-data:
|
|
ssl-certs:
|