version: '3.9' networks: public: external: true # overlay swarm — Attachable=false volumes: redis-data: dev-frontend-node_modules: dev-backend-node_modules: services: # ─── FILA DE TAREFAS + COORDENAÇÃO ─────────────────────────────── redis: image: redis:8-alpine networks: [public] volumes: - redis-data:/data deploy: replicas: 1 endpoint_mode: dnsrr healthcheck: test: ['CMD', 'redis-cli', 'ping'] interval: 5s timeout: 3s retries: 3 start_period: 10s # ─── TASKBOARD WEB (React standalone — sem build, direto no nginx) ── taskboard: image: nginx:alpine networks: [public] volumes: - /root/.openclaw/workspace/pulse-dev/taskboard/public:/usr/share/nginx/html:ro - /root/.openclaw/workspace/pulse-dev/taskboard/public/nginx.conf:/etc/nginx/conf.d/default.conf:ro deploy: replicas: 1 endpoint_mode: dnsrr labels: - caddy=board.octal.tec.br - caddy.reverse_proxy={{upstreams 80}} depends_on: redis: condition: service_healthy dev-frontend: image: node:24-alpine working_dir: /app networks: [public] volumes: - /root/.openclaw/workspace/pulse-dev/frontend:/app:cached - dev-frontend-node_modules:/app/node_modules command: > sh -c " if [ ! -d node_modules ]; then npm install react react-dom vite @vitejs/plugin-react typescript --save-dev 2>/dev/null; fi && echo 'FRONTEND hot reload iniciado em :5173' && npx vite --host 0.0.0.0 --port 5173 " deploy: replicas: 1 endpoint_mode: dnsrr labels: - caddy=frontend.octal.tec.br - caddy.reverse_proxy={{upstreams 5173}} healthcheck: test: ['CMD-SHELL', 'wget -qO- http://localhost:5173 | head -1'] interval: 15s timeout: 5s retries: 3 dev-backend: image: node:24-alpine working_dir: /app networks: [public] volumes: - /root/.openclaw/workspace/pulse-dev/backend:/app:cached - dev-backend-node_modules:/app/node_modules environment: - REDIS_URL=redis://redis:6379 - NODE_ENV=development command: > sh -c " if [ ! -d node_modules ]; then npm install tsx express ioredis cors helmet --save-dev 2>/dev/null; fi && echo 'BACKEND hot reload iniciado em :3001' && npx tsx watch --dir ./src server.ts " deploy: replicas: 1 endpoint_mode: dnsrr labels: - caddy=api.octal.tec.br - caddy.reverse_proxy={{upstreams 3001}} depends_on: redis: condition: service_healthy agent-frontend: image: node:24-alpine working_dir: /app networks: [public] volumes: - /root/.openclaw/workspace/pulse-dev/agents/frontend:/app:cached - dev-frontend-node_modules:/app/node_modules command: > sh -c " if [ ! -f /app/agent.js ]; then echo 'ESPERANDO CODIGO DO AGENTE FRONTEND' && sleep infinity; fi && if [ ! -d node_modules ]; then npm install ioredis uuid --save 2>/dev/null; fi && node /app/agent.js " environment: - REDIS_URL=redis://redis:6379 - AGENT_ID=agent-frontend - AGENT_ROLE=frontend - TASK_QUEUE=dev-tasks - LOG_CHANNEL=dev-logs deploy: replicas: 2 endpoint_mode: dnsrr depends_on: redis: condition: service_healthy restart_policy: condition: on-failure max_attempts: 5 delay: 5s agent-backend: image: node:24-alpine working_dir: /app networks: [public] volumes: - /root/.openclaw/workspace/pulse-dev/agents/backend:/app:cached - dev-backend-node_modules:/app/node_modules command: > sh -c " if [ ! -f /app/agent.js ]; then echo 'ESPERANDO CODIGO DO AGENTE BACKEND' && sleep infinity; fi && if [ ! -d node_modules ]; then npm install ioredis uuid --save 2>/dev/null; fi && node /app/agent.js " environment: - REDIS_URL=redis://redis:6379 - AGENT_ID=agent-backend - AGENT_ROLE=backend - TASK_QUEUE=dev-tasks - LOG_CHANNEL=dev-logs deploy: replicas: 2 endpoint_mode: dnsrr depends_on: redis: condition: service_healthy restart_policy: condition: on-failure max_attempts: 5 delay: 5s agent-devops: image: node:24-alpine working_dir: /app networks: [public] volumes: - /root/.openclaw/workspace/pulse-dev/agents/devops:/app:cached - /usr/local/bin/docker:/usr/local/bin/docker:ro - /var/run/docker.sock:/var/run/docker.sock:ro command: > sh -c " if [ ! -f /app/agent.js ]; then echo 'ESPERANDO CODIGO DO AGENTE DEVOPS' && sleep infinity; fi && npm install ioredis uuid 2>/dev/null && node /app/agent.js " environment: - REDIS_URL=redis://redis:6379 - AGENT_ID=agent-devops - AGENT_ROLE=devops - TASK_QUEUE=dev-tasks - LOG_CHANNEL=dev-logs deploy: replicas: 1 endpoint_mode: dnsrr depends_on: redis: condition: service_healthy restart_policy: condition: on-failure max_attempts: 5 delay: 5s