services:
  si-quiz:
    build: .
    container_name: si-quiz
    restart: unless-stopped
    ports:
      - "8000:8000"
    volumes:
      - ./data:/data
      - ./templates:/app/templates
      - ./static:/app/static
      - ./questions.json:/app/questions.json:ro
      - ./config.json:/app/config.json:ro
    environment:
      - DB_PATH=${DB_PATH:-/data/si-quiz.db}
      - CONFIG_PATH=${CONFIG_PATH:-config.json}
      - QUESTIONS_PATH=${QUESTIONS_PATH:-questions.json}
    networks:
      - si-quiz-net

networks:
  si-quiz-net:
    driver: bridge

# ── REVERSE PROXY NOTE ────────────────────────────────────────────────────────
# If you're using Caddy or nginx as a reverse proxy on the same Docker host,
# connect the container to your shared proxy network and remove the ports block.
# Example for Caddy (add to the si-quiz service):
#
#   networks:
#     - si-quiz-net
#     - web-net        # your Caddy shared network
#
# Caddyfile entry (no encode gzip — breaks WebSocket upgrade):
#
#   si-quiz.yourdomain.com {
#     reverse_proxy si-quiz:8000
#   }