# paperless-ngx - https://awesome-docker-compose.com/paperless-ngx
services:
  broker:
    image: docker.io/library/redis:7
    restart: unless-stopped
    volumes:
      - ${PAPERLESS_DATA}/redis-data:/data

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

  webserver:
    image: ghcr.io/paperless-ngx/paperless-ngx:latest
    restart: unless-stopped
    depends_on:
      - db
      - broker
    ports:
      - "3003:8000"
    volumes:
      - ${PAPERLESS_DATA}/data:/usr/src/paperless/data
      - ${PAPERLESS_DATA}/media:/usr/src/paperless/media
      - ${PAPERLESS_DATA}/export:/usr/src/paperless/export
      - ${PAPERLESS_DATA}/consume:/usr/src/paperless/consume
    environment:
      PAPERLESS_REDIS: redis://broker:6379
      PAPERLESS_DBHOST: db
      PAPERLESS_DBUSER: paperless
      PAPERLESS_DBPASS: ${DB_PASSWORD}
      PAPERLESS_SECRET_KEY: ${PAPERLESS_SECRET_KEY}
      PAPERLESS_URL: http://localhost:8000
      PAPERLESS_TIME_ZONE: America/New_York
      PAPERLESS_OCR_LANGUAGE: eng
      USERMAP_UID: 1000
      USERMAP_GID: 1000
      PAPERLESS_ADMIN_USER: ${PAPERLESS_ADMIN_USER}
      PAPERLESS_ADMIN_PASSWORD: ${PAPERLESS_ADMIN_PASSWORD}