Files
ulweb/docker-compose.yml
ulhub cbe0cc6da2 Replace browser MQTT bridge with backend device-events service
The frontend previously connected directly to the MQTT broker via a
CDN-loaded Paho client and a Paho-specific ws proxy. Move that
responsibility into the backend: DeviceDataService persists MQTT
messages to Postgres, and DeviceEventsController exposes them over a
REST endpoint plus a WebSocket gateway that the frontend now consumes
directly. Also adds a pgadmin service for inspecting the database.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-13 23:03:28 +00:00

69 lines
1.5 KiB
YAML

services:
postgres:
image: postgres:17
environment:
POSTGRES_DB: ulhub
POSTGRES_USER: ulhub
POSTGRES_PASSWORD: development
volumes:
- postgres-data:/var/lib/postgresql/data
mosquitto:
image: eclipse-mosquitto:2
ports:
- "1883:1883"
- "8883:8883"
- "9001:9001"
volumes:
- ./mosquitto:/mosquitto
backend:
build:
context: ./backend
dockerfile: Dockerfile
ports:
- "3001:3001"
depends_on:
- postgres
# Development mounts: mount source for hot-reload and keep container node_modules
volumes:
- ./backend:/usr/src/app:delegated
- /usr/src/app/node_modules
environment:
DATABASE_HOST: postgres
DATABASE_PORT: 5432
DATABASE_USER: ulhub
DATABASE_PASSWORD: development
DATABASE_NAME: ulhub
NODE_ENV: development
command: npm run start:dev
web:
build:
context: ./web
dockerfile: Dockerfile
ports:
- "3000:3000"
depends_on:
- backend
# Development mount: mount web code into container for Next.js dev server
volumes:
- ./web:/usr/src/app:delegated
- /usr/src/app/node_modules
environment:
BACKEND_HOST: http://backend:3001
NODE_ENV: development
command: npm run dev
pgadmin:
image: dpage/pgadmin4:8
environment:
PGADMIN_DEFAULT_EMAIL: admin@example.com
PGADMIN_DEFAULT_PASSWORD: admin
ports:
- "5050:80"
depends_on:
- postgres
volumes:
postgres-data: