version: '3.8'

services:
  devbench-manager:
    build: .
    container_name: devbench-manager
    restart: unless-stopped
    ports:
      - "9090:3001"
    environment:
      - NODE_ENV=production
      - PORT=3001
      - SECRET_KEY=${SECRET_KEY:-dev-secret-key-change-in-production}
      - ADMIN_EMAIL=${ADMIN_EMAIL:-admin@nabd-co.com}
      - ADMIN_PASSWORD=${ADMIN_PASSWORD:-admin123}
    volumes:
      - ./data:/app/data
      - ./logs:/app/logs
      - ./provision_vm.sh:/app/provision_vm.sh:ro
    healthcheck:
      test: [ "CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3001/health" ]
      interval: 30s
      timeout: 10s
      retries: 3
    networks:
      - app-network
      - caddy_network

networks:
  app-network:
    driver: bridge
  caddy_network:
    external: true
