From 0b255e063f0316516b634f528fa4d70da693c965 Mon Sep 17 00:00:00 2001 From: ZGaetano Date: Wed, 20 May 2026 13:48:27 -0400 Subject: [PATCH] feat(deploy): docker-compose.worker.yml for cluster worker nodes --- docker-compose.worker.yml | 52 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 docker-compose.worker.yml diff --git a/docker-compose.worker.yml b/docker-compose.worker.yml new file mode 100644 index 0000000..329aa4b --- /dev/null +++ b/docker-compose.worker.yml @@ -0,0 +1,52 @@ +# Wild Dragon MAM — Worker Node Stack +# ───────────────────────────────────── +# Deploy on any machine you want to join the cluster as a worker. +# The primary stack (mam-api, db, redis) continues running on TrueNAS. +# +# Required env vars (set in .env.worker or export before running): +# MAM_API_URL URL of the primary MAM API e.g. http://10.0.0.25:47432 +# NODE_TOKEN Bearer token from the primary's Tokens page +# +# Optional env vars (needed only if starting the worker profile): +# REDIS_URL, DATABASE_URL, S3_ENDPOINT, S3_BUCKET, S3_ACCESS_KEY, S3_SECRET_KEY +# +# Start node-agent only (cluster visibility + health): +# docker compose -f docker-compose.worker.yml up -d +# +# Start node-agent + job worker (full processing node): +# docker compose -f docker-compose.worker.yml --profile worker up -d + +services: + + node-agent: + build: ./services/node-agent + restart: unless-stopped + environment: + MAM_API_URL: ${MAM_API_URL} + NODE_TOKEN: ${NODE_TOKEN:-} + NODE_ROLE: ${NODE_ROLE:-worker} + AGENT_PORT: 3002 + HEARTBEAT_MS: ${HEARTBEAT_MS:-30000} + ports: + - "${AGENT_PORT:-7436}:3002" + networks: + - wild-dragon-worker + + worker: + build: ./services/worker + profiles: [worker] + restart: unless-stopped + environment: + REDIS_URL: ${REDIS_URL} + DATABASE_URL: ${DATABASE_URL} + S3_ENDPOINT: ${S3_ENDPOINT} + S3_BUCKET: ${S3_BUCKET} + S3_ACCESS_KEY: ${S3_ACCESS_KEY} + S3_SECRET_KEY: ${S3_SECRET_KEY} + S3_REGION: ${S3_REGION:-us-east-1} + networks: + - wild-dragon-worker + +networks: + wild-dragon-worker: + driver: bridge