agenthub/compose.coolify.yml
Paperclip FoundingEngineer b9e5262b85 feat(web): Add monitoring dashboard with Prometheus metrics visualization (BARAAA-98)
Implemented Phase 2 of AgentHub dashboard (BARAAA-53):

- Dashboard page with 8 real-time metric panels:
  * Agents connected (WebSocket gauge)
  * Active rooms, total messages
  * System uptime, HTTP requests, memory usage
  * WebSocket latency (p50/p99)
- Auto-refresh every 5s from /metrics Prometheus endpoint
- Prometheus text format parser
- Dashboard set as default view in navigation

Infrastructure:
- Multi-stage Dockerfile for web app (nginx runtime)
- Added web service to compose.coolify.yml
- Domain: dashboard.barodine.net
- Health checks, SSL via Traefik/Let's Encrypt

Documentation:
- Updated web/README.md with deployment instructions
- Added BARAAA-98-VERIFICATION.md

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-03 00:36:14 +00:00

176 lines
5.2 KiB
YAML

services:
app:
build:
context: .
dockerfile: Dockerfile
environment:
NODE_ENV: production
PORT: 3000
HOST: 0.0.0.0
LOG_LEVEL: info
POSTGRES_HOST: ${POSTGRES_HOST:-postgres}
POSTGRES_PORT: ${POSTGRES_PORT:-5432}
POSTGRES_USER: ${POSTGRES_USER:-agenthub}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB:-agenthub}
REDIS_HOST: ${REDIS_HOST:-redis}
REDIS_PORT: ${REDIS_PORT:-6379}
JWT_SECRET: ${JWT_SECRET}
ALLOWED_ORIGINS: ${ALLOWED_ORIGINS:-https://agenthub-v2.barodine.net}
networks:
- default
- coolify
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_started
restart: unless-stopped
labels:
- 'coolify.managed=true'
- 'coolify.name=agenthub'
- 'coolify.type=application'
- 'traefik.enable=true'
- 'traefik.docker.network=coolify'
- 'traefik.http.routers.agenthub.rule=Host(`agenthub-v2.barodine.net`)'
- 'traefik.http.routers.agenthub.entrypoints=websecure'
- 'traefik.http.routers.agenthub.tls=true'
- 'traefik.http.routers.agenthub.tls.certresolver=letsencrypt'
- 'traefik.http.services.agenthub.loadbalancer.server.port=3000'
- 'traefik.http.middlewares.agenthub-headers.headers.customrequestheaders.X-Forwarded-Proto=https'
- 'traefik.http.routers.agenthub.middlewares=agenthub-headers'
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:3000/healthz']
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
postgres:
image: postgres:16-alpine
environment:
POSTGRES_DB: ${POSTGRES_DB:-agenthub}
POSTGRES_USER: ${POSTGRES_USER:-agenthub}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_INITDB_ARGS: '--encoding=UTF8 --locale=C'
PGDATA: /var/lib/postgresql/data/pgdata
volumes:
- postgres_data_v2:/var/lib/postgresql/data
restart: unless-stopped
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U ${POSTGRES_USER:-agenthub} -d ${POSTGRES_DB:-agenthub}']
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
labels:
- 'coolify.managed=true'
- 'coolify.type=database'
redis:
image: redis:7-alpine
command:
- redis-server
- --save 60 100
- --appendonly yes
- --appendfsync everysec
- --maxmemory 256mb
- --maxmemory-policy allkeys-lru
volumes:
- redis_data:/data
restart: unless-stopped
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 10s
timeout: 3s
retries: 3
start_period: 5s
labels:
- 'coolify.managed=true'
- 'coolify.type=database'
web:
build:
context: ./web
dockerfile: Dockerfile
args:
VITE_API_URL: ${VITE_API_URL:-https://agenthub-v2.barodine.net}
networks:
- default
- coolify
depends_on:
app:
condition: service_healthy
restart: unless-stopped
labels:
- 'coolify.managed=true'
- 'coolify.name=agenthub-dashboard'
- 'coolify.type=application'
- 'traefik.enable=true'
- 'traefik.docker.network=coolify'
- 'traefik.http.routers.agenthub-dashboard.rule=Host(`dashboard.barodine.net`)'
- 'traefik.http.routers.agenthub-dashboard.entrypoints=websecure'
- 'traefik.http.routers.agenthub-dashboard.tls=true'
- 'traefik.http.routers.agenthub-dashboard.tls.certresolver=letsencrypt'
- 'traefik.http.services.agenthub-dashboard.loadbalancer.server.port=80'
- 'traefik.http.middlewares.agenthub-dashboard-headers.headers.customrequestheaders.X-Forwarded-Proto=https'
- 'traefik.http.routers.agenthub-dashboard.middlewares=agenthub-dashboard-headers'
healthcheck:
test: ['CMD', 'wget', '--no-verbose', '--tries=1', '--spider', 'http://localhost/healthz']
interval: 30s
timeout: 5s
retries: 3
start_period: 5s
backup:
build:
context: .
dockerfile: Dockerfile.backup
environment:
PGHOST: postgres
PGPORT: 5432
PGDATABASE: ${POSTGRES_DB:-agenthub}
PGUSER: ${POSTGRES_USER:-agenthub}
PGPASSWORD: ${POSTGRES_PASSWORD}
BACKUP_DIR: /backups
RETENTION_DAYS: ${BACKUP_RETENTION_DAYS:-14}
S3_ENDPOINT: ${S3_ENDPOINT:-}
S3_BUCKET: ${S3_BUCKET:-}
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID:-}
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY:-}
GPG_RECIPIENT_KEY: ${GPG_RECIPIENT_KEY:-}
volumes:
- backup_data:/backups
depends_on:
postgres:
condition: service_healthy
restart: 'no'
profiles:
- backup
labels:
- 'coolify.managed=true'
- 'coolify.type=service'
- 'ofelia.enabled=true'
- 'ofelia.job-exec.backup-daily.schedule=0 0 3 * * *'
- 'ofelia.job-exec.backup-daily.command=/usr/local/bin/backup.sh'
volumes:
postgres_data_v2:
driver: local
labels:
- 'coolify.managed=true'
redis_data:
driver: local
labels:
- 'coolify.managed=true'
backup_data:
driver: local
labels:
- 'coolify.managed=true'
networks:
default:
labels:
- 'coolify.managed=true'
coolify:
external: true