services:
  stocksearch:
    build: .
    restart: unless-stopped
    volumes:
      - ./.env:/app/.env:ro   # godotenv.Load()가 파일을 직접 읽도록 마운트
    expose:
      - "8080"

  caddy:
    image: caddy:alpine
    restart: unless-stopped
    ports:
      - "80:80"
      - "443:443"
      - "443:443/udp"   # HTTP/3
    volumes:
      - ./Caddyfile:/etc/caddy/Caddyfile:ro
      - caddy_data:/data     # Let's Encrypt 인증서 영구 보관
      - caddy_config:/config
    depends_on:
      - stocksearch

volumes:
  caddy_data:
  caddy_config:
