services:
  dashcaddy-api:
    build: .
    container_name: dashcaddy-api
    ports:
      - "3001:3001"
    volumes:
      - C:/Caddy/Caddyfile:/caddyfile:rw
      - C:/Caddy/services.json:/app/services.json:rw
      - C:/Caddy/dns-credentials.json:/app/dns-credentials.json:rw
      - C:/Caddy/config.json:/app/config.json:rw
      - C:/Caddy/totp-config.json:/app/totp-config.json:rw
      - C:/Caddy/credentials.json:/app/credentials.json:rw
      - C:/Caddy/.encryption-key:/app/.encryption-key:rw
      - C:/Caddy/.license-secret:/app/.license-secret:ro
      - C:/caddy/sites/status/assets:/app/assets:rw
      - C:/caddy/sites/ca:/app/ca:ro
      - C:/caddy/certs/pki/authorities/local:/app/pki:ro
      - C:/caddy/generated-certs:/app/generated-certs:rw
      - C:/caddy/sites/status/themes:/app/themes:rw
      - /var/run/docker.sock:/var/run/docker.sock
      # Media browser mounts - add your drives here for folder browsing
      # Format: HostPath:/browse/DriveLetter:ro (read-only for safety)
      - C:/:/browse/C:ro
      - D:/:/browse/D:ro
      - E:/:/browse/E:ro
    environment:
      - CADDYFILE_PATH=/caddyfile
      - CADDY_ADMIN_URL=http://host.docker.internal:2019
      - ASSETS_PATH=/app/assets
      - CREDENTIALS_FILE=/app/credentials.json
      # Configure your network IPs here for quick selection in Add Service modal
      - HOST_LAN_IP=192.168.254.204
      - HOST_TAILSCALE_IP=100.71.97.12
      # Media browser root mappings (container_path=host_path,...)
      - MEDIA_BROWSE_ROOTS=/browse/C=C:/,/browse/D=D:/,/browse/E=E:/
    extra_hosts:
      - "host.docker.internal:host-gateway"
    restart: unless-stopped
