services:
  paperless-ngx:
    image: ghcr.io/paperless-ngx/paperless-ngx:latest
    container_name: paperless-ngx
    restart: unless-stopped
    depends_on:
      - broker
      - db
    volumes:
      - data:/usr/src/paperless/data
      - media:/usr/src/paperless/media
    environment:
      PAPERLESS_REDIS: redis://paperless-ngx-broker:6379
      PAPERLESS_DBHOST: paperless-ngx-db
      PAPERLESS_DBPASS: ${POSTGRES_PASSWORD}
      PAPERLESS_URL: https://paperless.timo.bmrs.nl

      PAPERLESS_DISABLE_REGULAR_LOGIN: true
      PAPERLESS_APPS: allauth.socialaccount.providers.openid_connect
      PAPERLESS_SOCIALACCOUNT_PROVIDERS: ${PAPERLESS_SOCIALACCOUNT_PROVIDERS}

  broker:
    image: docker.io/library/redis:7
    container_name: paperless-ngx-broker
    restart: unless-stopped
    volumes:
      - data_redis:/data

  db:
    image: docker.io/library/postgres:16
    container_name: paperless-ngx-db
    restart: unless-stopped
    volumes:
      - data_db:/var/lib/postgresql/data
    environment:
      POSTGRES_DB: paperless
      POSTGRES_USER: paperless
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}


volumes:
  data:
  data_db:
  data_redis:
  media:

networks:
  default:
    name: proxy
    external: true
