1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Paperless-ngxをDockerでサクッと立ててSSO出来るCompose

Posted at

より良いペーパーレスライフをエンジョイするために導入してみました。

compose.yaml
services:
  broker:
    image: docker.io/library/redis:8
    restart: unless-stopped
    volumes:
      - ./redis:/data
  db:
    image: docker.io/library/postgres:18
    restart: unless-stopped
    volumes:
      - ./db:/var/lib/postgresql
    environment:
      POSTGRES_DB: paperless
      POSTGRES_USER: paperless
      POSTGRES_PASSWORD: paperless
  webserver:
    image: ghcr.io/paperless-ngx/paperless-ngx:latest
    restart: unless-stopped
    depends_on:
      - db
      - broker
      - gotenberg
      - tika
    ports:
      - <適宜設定>:8000
    volumes:
      - ./pl-data:/usr/src/paperless/data
      - ./pl-media:/usr/src/paperless/media
      - ./pl-export:/usr/src/paperless/export
      - ./pl-consume:/usr/src/paperless/consume
    env_file: .env
  gotenberg:
    image: docker.io/gotenberg/gotenberg:8.24
    restart: unless-stopped
    command:
      - gotenberg
      - --chromium-disable-javascript=true
      - --chromium-allow-list=file:///tmp/.*
  tika:
    image: docker.io/apache/tika:latest
    restart: unless-stopped
networks: {}
.env
PAPERLESS_SECRET_KEY=<適当な文字列、長くてエントロピーが大きければ大きいほどベター)
PAPERLESS_URL=https://paperless.example.com
PAPERLESS_REDIS=redis://broker:6379
PAPERLESS_DBHOST=db
PAPERLESS_TIKA_ENABLED=1
PAPERLESS_TIKA_GOTENBERG_ENDPOINT=http://gotenberg:3000
PAPERLESS_TIKA_ENDPOINT=http://tika:9998
PAPERLESS_OCR_LANGUAGES=jpn eng
PAPERLESS_DB_READ_CACHE_ENABLED=true
PAPERLESS_REDIRECT_LOGIN_TO_SSO=true
PAPERLESS_DISABLE_REGULAR_LOGIN=true
PAPERLESS_APPS: "allauth.socialaccount.providers.openid_connect"
PAPERLESS_SOCIALACCOUNT_PROVIDERS: '{"openid_connect": {"APPS": [{"provider_id": "microsoft365","name": "Microsoft365","client_id": "<ここにアプリケーションID>","secret": "<ここにシークレット>","settings": { "server_url": "https://login.microsoftonline.com/<テナントID>/v2.0/.well-known/openid-configuration"}}]}}'

上記でいい感じにSSO出来てるのでそのまま動かしてます。
その他の設定はここに書いてあるので、適当に弄くればOK。

日本語OCR対応と、文字情報が埋め込まれたPDFをインポートしたときに文字化けする場合は下記の設定をすると解決する。

  • 出力タイプをpdfに明示的指定する
  • 言語をjpn + engにする
    image.png
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?