From a10404c4189ca02e952e43a08ae01b577f6e204d Mon Sep 17 00:00:00 2001 From: Eugen Ciur Date: Sun, 21 Jan 2024 12:58:14 +0100 Subject: [PATCH] documentation update (#89) --- docs/setup/docker-compose.md | 249 ++++++++++++++++++++--------------- docs/setup/docker.md | 12 +- mkdocs.yml | 2 +- 3 files changed, 151 insertions(+), 112 deletions(-) diff --git a/docs/setup/docker-compose.md b/docs/setup/docker-compose.md index 7f662cab..2f5ee938 100644 --- a/docs/setup/docker-compose.md +++ b/docs/setup/docker-compose.md @@ -14,8 +14,8 @@ The simpliest docker compose setup for {{ extra.project }} is following: image: papermerge/papermerge:{{ extra.docker_image_version }} environment: PAPERMERGE__SECURITY__SECRET_KEY: 12345 - PAPERMERGE__AUTH__USERNAME: john - PAPERMERGE__AUTH__PASSWORD: hohoho + PAPERMERGE__AUTH__USERNAME: admin + PAPERMERGE__AUTH__PASSWORD: admin PAPERMERGE__REDIS__URL: redis://redis:6379/0 volumes: - data:/db @@ -37,6 +37,7 @@ The simpliest docker compose setup for {{ extra.project }} is following: data: index_db: media: + ``` You can access {{ extra.project }} user interface using any modern web browser (e.g. Firefox, Chrome). @@ -54,11 +55,11 @@ uses PostgreSQL: x-backend: &common image: papermerge/papermerge:{{ extra.docker_image_version }} environment: - PAPERMERGE__SECURITY__SECRET_KEY: 12345 - PAPERMERGE__AUTH__USERNAME: john - PAPERMERGE__AUTH__PASSWORD: hohoho - PAPERMERGE__DATABASE__URL: postgresql://scott:tiger@db:5432/mydatabase - PAPERMERGE__REDIS__URL: redis://redis:6379/0 + PAPERMERGE__SECURITY__SECRET_KEY: 12345 + PAPERMERGE__AUTH__USERNAME: admin + PAPERMERGE__AUTH__PASSWORD: admin + PAPERMERGE__DATABASE__URL: postgresql://coco:kesha@db:5432/cocodb + PAPERMERGE__REDIS__URL: redis://redis:6379/0 volumes: - index_db:/core_app/index_db - media:/core_app/media @@ -68,21 +69,29 @@ uses PostgreSQL: ports: - "12000:80" depends_on: - - redis - - db + db: + condition: service_healthy + redis: + condition: service_healthy worker: <<: *common command: worker redis: image: redis:6 db: - image: bitnami/postgresql:14.4.0 + image: postgres:16.1 volumes: - postgres_data:/var/lib/postgresql/data/ environment: - POSTGRES_USER: scott - POSTGRES_PASSWORD: tiger - POSTGRES_DB: mydatabase + POSTGRES_PASSWORD: kesha + POSTGRES_DB: cocodb + POSTGRES_USER: coco + healthcheck: + test: pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB + interval: 5s + timeout: 10s + retries: 5 + start_period: 10s volumes: postgres_data: index_db: @@ -96,56 +105,70 @@ By default {{ extra.project }} uses Xapian search engine. However, for production environments, full fledged search engine like Solr is recommanded. ```yaml -version: "3.9" - -x-backend: &common - image: papermerge/papermerge:{{ extra.docker_image_version }} - environment: - PAPERMERGE__SECURITY__SECRET_KEY: 12345 - PAPERMERGE__AUTH__USERNAME: john - PAPERMERGE__AUTH__PASSWORD: hohoho - PAPERMERGE__DATABASE__URL: postgresql://scott:tiger@db:5432/mydatabase - PAPERMERGE__REDIS__URL: redis://redis:6379/0 - PAPERMERGE__SEARCH__URL: solr://solr:8983/pmg-index - volumes: - - media:/core_app/media + version: "3.9" -services: - web: - <<: *common - ports: - - "12000:80" - depends_on: - - redis - - db - - solr - worker: - <<: *common - command: worker - redis: - image: redis:6 - db: - image: bitnami/postgresql:14.4.0 - volumes: - - postgres_data:/var/lib/postgresql/data/ + x-backend: &common + image: papermerge/papermerge:{{ extra.docker_image_version }} environment: - POSTGRES_USER: scott - POSTGRES_PASSWORD: tiger - POSTGRES_DB: mydatabase - solr: - image: solr:9.3 - ports: - - "8983:8983" + PAPERMERGE__SECURITY__SECRET_KEY: 1234 # top secret + PAPERMERGE__AUTH__USERNAME: admin + PAPERMERGE__AUTH__PASSWORD: admin + PAPERMERGE__DATABASE__URL: postgresql://coco:kesha@db:5432/cocodb + PAPERMERGE__REDIS__URL: redis://redis:6379/0 + PAPERMERGE__SEARCH__URL: solr://solr:8983/pmg-index volumes: - - solr_data:/var/solr - command: - - solr-precreate - - pmg-index - -volumes: - postgres_data: - solr_data: - media: + - media_root:/core_app/media + depends_on: + db: + condition: service_healthy + redis: + condition: service_healthy + + services: + web: + <<: *common + ports: + - "12000:80" + worker: + <<: *common + command: worker + redis: + image: redis:6 + healthcheck: + test: redis-cli --raw incr ping + interval: 5s + timeout: 10s + retries: 5 + start_period: 10s + solr: + image: solr:9.3 + ports: + - "8983:8983" + volumes: + - solr_data:/var/solr + command: + - solr-precreate + - pmg-index + db: + image: postgres:16.1 + volumes: + - postgres_data:/var/lib/postgresql/data/ + environment: + POSTGRES_PASSWORD: kesha + POSTGRES_DB: cocodb + POSTGRES_USER: coco + + healthcheck: + test: pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB + interval: 5s + timeout: 10s + retries: 5 + start_period: 10s + + volumes: + postgres_data: + solr_data: + media_root: ``` ## MySQL / MariaDB @@ -153,56 +176,72 @@ volumes: Here is an example of docker compose setup with MariaDB: ```yaml -version: "3.9" + version: "3.9" -x-backend: &common - image: papermerge/papermerge:{{ extra.docker_image_version }} - environment: + x-backend: &common + image: papermerge/papermerge:{{ extra.docker_image_version }} + environment: PAPERMERGE__SECURITY__SECRET_KEY: 1234 # top secret - PAPERMERGE__AUTH__USERNAME: eugen - PAPERMERGE__AUTH__PASSWORD: 1234 - PAPERMERGE__DATABASE__URL: mysql://myuser:mypass@db:3306/paperdb + PAPERMERGE__AUTH__USERNAME: admin + PAPERMERGE__AUTH__PASSWORD: admin + PAPERMERGE__DATABASE__URL: mysql://coco:kesha@db:3306/cocodb PAPERMERGE__REDIS__URL: redis://redis:6379/0 PAPERMERGE__SEARCH__URL: solr://solr:8983/pmg-index - volumes: - - media_root:/core_app/media - depends_on: - - redis - - solr - - db - -services: - web: - <<: *common - ports: - - "11000:80" - worker: - <<: *common - command: worker - redis: - image: redis:6 - solr: - image: solr:9.3 - ports: - - "8983:8983" - volumes: - - solr_data:/var/solr - command: - - solr-precreate - - pmg-index - db: - image: mariadb:11.2 volumes: - - maria:/var/lib/mysql - environment: - MYSQL_ROOT_PASSWORD: mypass - MYSQL_DATABASE: paperdb - MYSQL_USER: myuser - MYSQL_PASSWORD: mypass -volumes: - maria: - solr_data: - media_root: + - media_root:/core_app/media + depends_on: + db: + condition: service_healthy + redis: + condition: service_healthy + + services: + web: + <<: *common + ports: + - "12000:80" + worker: + <<: *common + command: worker + redis: + image: redis:6 + healthcheck: + test: redis-cli --raw incr ping + interval: 5s + timeout: 10s + retries: 5 + start_period: 10s + solr: + image: solr:9.3 + ports: + - "8983:8983" + volumes: + - solr_data:/var/solr + command: + - solr-precreate + - pmg-index + db: + image: mariadb:11.2 + volumes: + - maria:/var/lib/mysql + environment: + MYSQL_ROOT_PASSWORD: kesha + MYSQL_DATABASE: cocodb + MYSQL_USER: coco + MYSQL_PASSWORD: kesha + ports: + - "3306:3306" + healthcheck: + test: mariadb-admin ping -h 127.0.0.1 -u $$MYSQL_USER --password=$$MYSQL_PASSWORD + interval: 5s + timeout: 10s + retries: 5 + start_period: 10s + + volumes: + postgres_data: + solr_data: + media_root: ``` ## OAuth 2.0 diff --git a/docs/setup/docker.md b/docs/setup/docker.md index 95ba3433..91197709 100644 --- a/docs/setup/docker.md +++ b/docs/setup/docker.md @@ -7,13 +7,13 @@ The only two required environment variables are web ui part use following command: ```console -docker run -p 9400:80 \ +docker run -p 12000:80 \ -e PAPERMERGE__SECURITY__SECRET_KEY=abc \ - -e PAPERMERGE__AUTH__PASSWORD=123 \ + -e PAPERMERGE__AUTH__PASSWORD=admin \ papermerge/papermerge:{{ extra.docker_image_version }} ``` -Point your web browser to `http://localhost:9400` and you will see login screen: +Point your web browser to `http://localhost:12000` and you will see login screen: ![login screen](../img/setup/login.png) @@ -22,7 +22,7 @@ Point your web browser to `http://localhost:9400` and you will see login screen: Credentials are: - username `admin` -- password `123` +- password `admin` !!! Note @@ -59,8 +59,8 @@ Here is minimal docker compose file with web UI and one worker: image: papermerge/papermerge:{{ extra.docker_image_version }} environment: PAPERMERGE__SECURITY__SECRET_KEY: 12345 - PAPERMERGE__AUTH__USERNAME: john - PAPERMERGE__AUTH__PASSWORD: hohoho + PAPERMERGE__AUTH__USERNAME: admin + PAPERMERGE__AUTH__PASSWORD: admin PAPERMERGE__REDIS__URL: redis://redis:6379/0 volumes: - data:/db diff --git a/mkdocs.yml b/mkdocs.yml index 1fa5ef90..493985a0 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -75,7 +75,7 @@ theme: repo_url: https://github.com/ciur/papermerge extra: project: Papermerge # custom variable for macros plugin - docker_image_version: 3.0.1 # latest docker image version e.g. 3.0, 3.0.1, 3.1.9, 3.0a1 + docker_image_version: 3.0.2 # latest docker image version e.g. 3.0, 3.0.1, 3.1.9, 3.0a1 version: provider: mike social: