#!/bin/bash set -e up () { docker network create pew-net || true # Exposed on port 8000 in pew-net docker run \ --detach \ --name paperless \ --restart unless-stopped \ --env USERMAP_UID=1000 \ --env USERMAP_GID=1000 \ --env PAPERLESS_REDIS=redis://paperless-redis:6379 \ --env PAPERLESS_DBHOST=paperless-psql \ --env PAPERLESS_TIKA_ENABLED=1 \ --env PAPERLESS_TIKA_GOTENBERG_EDPOINT=http://paperless-gotenberg:3000 \ --env PAPERLESS_TIKA_ENDPOINT=http://paperless-tika:9998 \ --volume /bigdata/k8s-config/paperless/paperless/data:/usr/src/paperless/data:rw \ --volume /bigdata/k8s-config/paperless/paperless/media:/usr/src/paperless/media:rw \ --volume /bigdata/k8s-config/paperless/paperless/export:/usr/src/paperless/export:rw \ --volume /bigdata/k8s-config/paperless/paperless/consume:/usr/src/paperless/consume:rw \ --network pew-net \ docker.io/jonaswinkler/paperless-ng:latest docker run \ --detach \ --name paperless-gotenberg \ --restart unless-stopped \ --env DISABLE_GOOGLE_CHROME=1 \ --network pew-net \ docker.io/thecodingmachine/gotenberg:latest docker run \ --detach \ --name paperless-psql \ --env POSTGRES_DB=paperless \ --env POSTGRES_USER=paperless \ --env POSTGRES_PASSWORD=paperless \ --volume /bigdata/k8s-config/paperless/postgres:/var/lib/postgresql/data:rw \ --network pew-net \ docker.io/postgres:13 docker run \ --detach \ --name paperless-redis \ --restart unless-stopped \ --network pew-net \ docker.io/redis:6.0 docker run \ --detach \ --name paperless-tika \ --restart unless-stopped \ --network pew-net \ docker.io/apache/tika:latest } down () { docker stop paperless || true docker rm paperless || true docker stop paperless-gotenberg || true docker rm paperless-gotenberg || true docker stop paperless-psql || true docker rm paperless-psql || true docker stop paperless-redis || true docker rm paperless-redis || true docker stop paperless-tika || true docker rm paperless-tika || true } logs () { docker logs --follow paperless } logsg () { docker logs --follow paperless-gotenberg } logsp () { docker logs --follow paperless-psql } logsr () { docker logs --follow paperless-redis } logst () { docker logs --follow paperless-tika } $@