services:
  app:
    image: mauriceboe/trek:latest
    container_name: trek
    read_only: true
    security_opt:
      - no-new-privileges:true
    cap_drop:
      - ALL
    cap_add:
      - CHOWN
      - SETUID
      - SETGID
    tmpfs:
      - /tmp:noexec,nosuid,size=64m
    ports:
      - "8083:3000"
    environment:
      - NODE_ENV=production
      - PORT=3000
      - ENCRYPTION_KEY=${ENCRYPTION_KEY}
      - TZ=Europe/Lisbon
      - LOG_LEVEL=info
      - ALLOWED_ORIGINS=https://trek.lino.cooking
      - FORCE_HTTPS=true
      - TRUST_PROXY=1
      - ALLOW_INTERNAL_NETWORK=trur
      - APP_URL=https://trek.lino.cooking
      - OIDC_ISSUER=https://auth.lino.cooking
      - OIDC_CLIENT_ID=652278a5-b695-4589-9d51-d23cfb2e15dd
      - OIDC_CLIENT_SECRET=${OIDC_CLIENT_SECRET}
      - OIDC_DISPLAY_NAME=PocketID
      - OIDC_ONLY=true
      - OIDC_DISCOVERY_URL=https://auth.lino.cooking/.well-known/openid-configuration
    volumes:
      - /data/trek/app:/app/data
      - /data/trek/uploads:/app/uploads
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "wget", "-qO-", "http://localhost:3000/api/health"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 15s
