version: "3.9"

services:
  contract-companion:
    build: .
    container_name: contract-companion
    restart: unless-stopped
    environment:
      - PORT=8000
      - LOG_LEVEL=info
      - DATABASE_PATH=/app/data/contracts.db
      - PAPERLESS_BASE_URL=http://paperless:8000
      - PAPERLESS_EXTERNAL_URL=http://paperless:8000
      - PAPERLESS_TOKEN=replace-with-token
      - ALERT_DAYS_BEFORE=45
      - SCHEDULER_INTERVAL_MINUTES=60
      - AUTH_USERNAME=admin
      - AUTH_PASSWORD=change-me
      - AUTH_JWT_SECRET=replace-with-random-secret
      - AUTH_TOKEN_EXPIRES_IN_HOURS=12
      # Optional ntfy push settings:
      # - NTFY_SERVER_URL=https://ntfy.example.com
      # - NTFY_TOPIC=contracts
      # - NTFY_TOKEN=secret
      # - NTFY_PRIORITY=high
      # Optional mail settings:
      # - MAIL_SERVER=smtp.example.com
      # - MAIL_PORT=587
      # - MAIL_USERNAME=mailer
      # - MAIL_PASSWORD=secret
      # - MAIL_USE_TLS=true
      # - MAIL_FROM=contract-monitor@example.com
      # - MAIL_TO=you@example.com
      # Optional: festen iCal-Token vorgeben
      # - ICAL_SECRET=replace-with-secret
    volumes:
      - contracts-data:/app/data
    ports:
      - "8080:8000"
  contract-companion-ui:
    build:
      context: ./frontend
    container_name: contract-companion-ui
    restart: unless-stopped
    ports:
      - "8081:80"
    depends_on:
      - contract-companion

volumes:
  contracts-data:
