services:
  caddy:
    image: caddy:2-alpine
    container_name: kipina-caddy
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./Caddyfile.prod:/etc/caddy/Caddyfile
      - caddy_data:/data
      - caddy_config:/config
    restart: unless-stopped
    depends_on:
      - hub

  hub:
    image: kipina-agentic:latest
    container_name: kipina-agentic-hub
    restart: unless-stopped
    environment:
      - DATABASE_PATH=/data/nodes.db
      - STATIC_DIR=/app/frontend/dist
      - ADMIN_PASSWORD=${ADMIN_PASSWORD:-}
      - NODE_API_KEY=${NODE_API_KEY:-}
    volumes:
      - hub_data:/data
      # Frontend-tiedostot päivitetään ilman kontin rebuildia
      - ./frontend/dist:/app/frontend/dist:ro

volumes:
  caddy_data:
  caddy_config:
  hub_data:
