version: '3.8'

services:
  chess-tutor:
    image: ghcr.io/stefan-kp/chess-tutor:latest
    container_name: chess-tutor
    restart: unless-stopped

    ports:
      - "3050:3050"

      # Data Privacy & Imprint Configuration
      IMPRINT_URL: ${IMPRINT_URL:-}
      DATA_PRIVACY_RESPONSIBLE_PERSON: ${DATA_PRIVACY_RESPONSIBLE_PERSON:-}
      
    env_file:
      - .env

    environment:
      - NODE_ENV=production

    healthcheck:
      test: ["CMD", "node", "-e", "require('http').get('http://localhost:3050', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 40s

    networks:
      - chess-tutor-network

networks:
  chess-tutor-network:
    driver: bridge
