bytelyst-devops-tools/dashboard/docker-compose.yml
Hermes VM 2fc23d6baa feat(vm): fix devops-backend VM module — Phase 0.1 complete
- Switch backend runner from node:20-alpine to node:20-slim so GNU df
  flags (--output=pcent/avail) work inside the container
- Add volume mounts to docker-compose.yml: scripts (ro), VM logs (rw),
  docker.sock; set VM_SCRIPTS_PATH + VM_LOG_DIR env vars
- Rebuild repository.ts: env-configurable paths, cron history parser,
  unhealthy-container inspector, Ollama model endpoints
- Add routes: GET /api/vm/cron-status, unhealthy containers, Ollama
  models, container restart, model unload
- vm-cleanup.sh: add step_cosmos_pglog, step_docker_aged_images; fix
  (( count++ )) → count=$(( count + 1 )) for set -e compatibility
- Add docs/VM_OBSERVABILITY_ROADMAP.md

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-27 21:13:45 +00:00

84 lines
2.7 KiB
YAML

# Production-mode compose for DevOps Dashboard
# Usage:
# docker compose up --build
#
# Requires:
# - backend/.env populated (copy from backend/.env.example)
# - web/.env.local populated (copy from web/.env.local.example)
#
# For hot-reload dev mode use:
# docker compose -f docker-compose.yml -f docker-compose.dev.yml up
services:
# ---------------------------------------------------------------------------
# Backend — DevOps API service
# ---------------------------------------------------------------------------
backend:
build:
context: .
dockerfile: backend/Dockerfile
args:
BYTELYST_PACKAGE_SOURCE: ${BYTELYST_PACKAGE_SOURCE:-vendor}
container_name: devops-backend
env_file:
- backend/.env
environment:
- VM_SCRIPTS_PATH=/vm-scripts/VMs/HostingerVM
- VM_LOG_DIR=/host-logs
ports:
- '4004:4004'
networks:
- default
- platform_net
volumes:
# Read-only access to VM management scripts
- /opt/bytelyst/learning_ai_devops_tools/scripts:/vm-scripts:ro
# Read-write access to VM log files (cleanup + health-check write here)
- /var/log/vm-cleanup.log:/host-logs/vm-cleanup.log
- /var/log/vm-health-check.log:/host-logs/vm-health-check.log
- /var/log/docker-watchdog.log:/host-logs/docker-watchdog.log
# Docker socket — allows running docker commands against the host daemon
# (same pattern as Portainer/cAdvisor; container already runs as root)
- /var/run/docker.sock:/var/run/docker.sock
extra_hosts:
# Reach the host for Ollama API (port 11434) and host-only services
- "host-gateway:host-gateway"
restart: unless-stopped
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:4004/health']
interval: 30s
timeout: 5s
retries: 3
start_period: 15s
# ---------------------------------------------------------------------------
# Web — Next.js dashboard
# ---------------------------------------------------------------------------
web:
build:
context: .
dockerfile: web/Dockerfile
args:
BYTELYST_PACKAGE_SOURCE: ${BYTELYST_PACKAGE_SOURCE:-vendor}
NEXT_PUBLIC_PRODUCT_ID: ${NEXT_PUBLIC_PRODUCT_ID:-devops}
NEXT_PUBLIC_PLATFORM_URL: https://api.bytelyst.com/platform/api
NEXT_PUBLIC_DEVOPS_API_URL: https://api.bytelyst.com/devops
container_name: devops-web
ports:
- '3049:3000'
networks:
- default
- platform_net
restart: unless-stopped
depends_on:
backend:
condition: service_healthy
environment:
- NODE_ENV=production
networks:
default: {}
platform_net:
external: true
name: learning_ai_common_plat_default