version: "3.9"

services:
  motief:
    image: ${DOCKER_REGISTRY}/sgeboers/stemwijzer:latest
    ports:
      - "127.0.0.1:8501:8501"
    volumes:
      - ${DATA_DIR:-/home/webapps/motief/data}:/home/app/app/data
    restart: unless-stopped
    environment:
      - PYTHONPATH=/home/app/app
      - OPENROUTER_API_KEY
      - DB_PATH=/home/app/app/data/motions.db
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8501/"]
      interval: 30s
      timeout: 3s
      retries: 3
      start_period: 15s

  scheduler:
    image: ${DOCKER_REGISTRY}/sgeboers/stemwijzer:latest
    command: python scheduler.py
    volumes:
      - ${DATA_DIR:-/home/webapps/motief/data}:/home/app/app/data
    restart: unless-stopped
    environment:
      - PYTHONPATH=/home/app/app
      - OPENROUTER_API_KEY
      - OPENAI_API_KEY
      - DB_PATH=/home/app/app/data/motions.db
