mirror of
https://github.com/gadgethd/ukmesh.git
synced 2026-09-11 09:35:35 +00:00
www.ukmesh.com (website-ukmesh container, port 3004):
- UKLayout, UKHomePage, UKInstallPage, UKMqttPage components
- VITE_SITE=ukmesh build arg routes to UK pages in main.tsx
- Stats fetched via relative /api path (proxied by Nginx)
app.ukmesh.com (app-ukmesh container, port 3003):
- Same dashboard build with VITE_APP_HOSTNAME=app.ukmesh.com
- VITE_NETWORK=ukmesh for future API filtering
MQTT:
- node-ukmesh Mosquitto user for ukmesh observer nodes
- ACL updated: backend reads meshcore/# and ukmesh/#
- ukmesh nodes publish to ukmesh/{IATA}/{PUBKEY}/packets
Cloudflare routes to add in Zero Trust:
www.ukmesh.com -> http://website-ukmesh:80
app.ukmesh.com -> http://app-ukmesh:80
mqtt.ukmesh.com -> http://mosquitto:9001
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
160 lines
3.9 KiB
YAML
160 lines
3.9 KiB
YAML
services:
|
|
timescaledb:
|
|
image: timescale/timescaledb:latest-pg16
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_DB: ${POSTGRES_DB:-meshcore}
|
|
POSTGRES_USER: ${POSTGRES_USER:-meshcore}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD required}
|
|
volumes:
|
|
- timescaledb_data:/var/lib/postgresql/data
|
|
- ./backend/src/db/schema.sql:/docker-entrypoint-initdb.d/001_schema.sql:ro
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-meshcore} -d ${POSTGRES_DB:-meshcore}"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 10
|
|
start_period: 30s
|
|
|
|
mosquitto:
|
|
image: eclipse-mosquitto:2
|
|
restart: unless-stopped
|
|
volumes:
|
|
- ./mosquitto:/mosquitto/config
|
|
- mosquitto_data:/mosquitto/data
|
|
- mosquitto_log:/mosquitto/log
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
restart: unless-stopped
|
|
volumes:
|
|
- redis_data:/data
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
backend:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.backend
|
|
restart: unless-stopped
|
|
environment:
|
|
DATABASE_URL: postgresql://${POSTGRES_USER:-meshcore}:${POSTGRES_PASSWORD}@timescaledb:5432/${POSTGRES_DB:-meshcore}
|
|
MQTT_BROKER_URL: ${MQTT_BROKER_URL:-ws://mosquitto:9001}
|
|
MQTT_USERNAME: ${MQTT_USERNAME:-backend}
|
|
MQTT_PASSWORD: ${MQTT_PASSWORD}
|
|
REDIS_URL: ${REDIS_URL:-redis://redis:6379}
|
|
JWT_SECRET: ${JWT_SECRET:?JWT_SECRET required}
|
|
OPENTOPODATA_API: ${OPENTOPODATA_API:-https://api.opentopodata.org}
|
|
PORT: ${PORT:-3000}
|
|
MESHCORE_CHANNEL_SECRETS: ${MESHCORE_CHANNEL_SECRETS:-}
|
|
ALLOWED_ORIGINS: ${ALLOWED_ORIGINS:-http://localhost:3001,http://localhost:3002}
|
|
NODE_ENV: production
|
|
depends_on:
|
|
timescaledb:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
mosquitto:
|
|
condition: service_started
|
|
ports:
|
|
- "3000:3000"
|
|
|
|
app:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.app
|
|
args:
|
|
VITE_APP_HOSTNAME: ${VITE_APP_HOSTNAME:-}
|
|
restart: unless-stopped
|
|
depends_on:
|
|
- backend
|
|
ports:
|
|
- "3001:80"
|
|
|
|
viewshed-worker:
|
|
build:
|
|
context: ./viewshed-worker
|
|
dockerfile: Dockerfile
|
|
restart: unless-stopped
|
|
environment:
|
|
DATABASE_URL: postgresql://${POSTGRES_USER:-meshcore}:${POSTGRES_PASSWORD}@timescaledb:5432/${POSTGRES_DB:-meshcore}
|
|
REDIS_URL: ${REDIS_URL:-redis://redis:6379}
|
|
SRTM_DIR: /data/srtm
|
|
NUM_WORKERS: '1'
|
|
volumes:
|
|
- srtm_data:/data/srtm
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: '1.5'
|
|
memory: '5g'
|
|
depends_on:
|
|
timescaledb:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
|
|
website:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.website
|
|
args:
|
|
VITE_APP_HOSTNAME: ${VITE_APP_HOSTNAME:-}
|
|
VITE_SITE: teesside
|
|
restart: unless-stopped
|
|
ports:
|
|
- "3002:80"
|
|
depends_on:
|
|
- backend
|
|
|
|
app-ukmesh:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.app
|
|
args:
|
|
VITE_APP_HOSTNAME: app.ukmesh.com
|
|
VITE_NETWORK: ukmesh
|
|
restart: unless-stopped
|
|
depends_on:
|
|
- backend
|
|
ports:
|
|
- "3003:80"
|
|
|
|
website-ukmesh:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.website
|
|
args:
|
|
VITE_APP_HOSTNAME: app.ukmesh.com
|
|
VITE_SITE: ukmesh
|
|
restart: unless-stopped
|
|
ports:
|
|
- "3004:80"
|
|
depends_on:
|
|
- backend
|
|
|
|
cloudflared:
|
|
image: cloudflare/cloudflared:latest
|
|
restart: unless-stopped
|
|
command: tunnel run
|
|
profiles: [tunnel]
|
|
environment:
|
|
TUNNEL_TOKEN: ${CLOUDFLARE_TUNNEL_TOKEN}
|
|
depends_on:
|
|
- backend
|
|
- app
|
|
- website
|
|
- app-ukmesh
|
|
- website-ukmesh
|
|
- mosquitto
|
|
|
|
volumes:
|
|
timescaledb_data:
|
|
mosquitto_data:
|
|
mosquitto_log:
|
|
redis_data:
|
|
srtm_data:
|