services:
  relay:
    build: .
    restart: unless-stopped
    mem_limit: 128m
    stop_grace_period: 15s
    volumes:
      - logs:/data
    ports:
      - "127.0.0.1:8080:8080"
    environment:
      OAUTH_BASE_URL: https://ice.plezy.app
      TRUSTED_PROXY_CIDRS: ${TRUSTED_PROXY_CIDRS:?Set TRUSTED_PROXY_CIDRS to the reverse proxy network CIDR}
      MAL_CLIENT_ID: ${MAL_CLIENT_ID:-}
      ANILIST_CLIENT_ID: ${ANILIST_CLIENT_ID:-}
      ANILIST_CLIENT_SECRET: ${ANILIST_CLIENT_SECRET:-}
    logging:
      driver: "json-file"
      options:
        max-size: "10m"
        max-file: "3"

  bugs:
    # Update the source-revision tag, index digest, and platforms together using CONTRIBUTING.md.
    # Platforms: linux/amd64, linux/arm64
    image: ghcr.io/edde746/bugs:sha-319e0eb@sha256:1e5a2d8ab80e703de4a8a8b15d858ce931609e2226bf1e6d04979c0ca52a3005
    restart: unless-stopped
    mem_limit: 512m
    volumes:
      - bugs_data:/data
    environment:
      BUGS_AUTH__ADMIN_TOKEN: ${BUGS_AUTH__ADMIN_TOKEN}
      BUGS_PUBLIC_URL: https://bugs.plezy.app
      BUGS_RETENTION_DAYS: 90
      BUGS_SYMBOLICATION__NATIVE_SYMCACHE_CACHE_BYTES_MB: 128
      BUGS_INGEST__MAX_RAW_REQUEST_BYTES: 536870912
      BUGS_SQLITE__READER_CONNECTIONS: 4
      BUGS_SQLITE__CACHE_SIZE_MB: 16
      BUGS_SQLITE__MMAP_SIZE_MB: 64
    ports:
      - "127.0.0.1:9000:9000"
    logging:
      driver: "json-file"
      options:
        max-size: "10m"
        max-file: "3"

volumes:
  logs:
  bugs_data:
