Skip to content

Commit

Permalink
upgrade papermerge
Browse files Browse the repository at this point in the history
  • Loading branch information
stehessel committed Oct 29, 2023
1 parent a21c9bf commit a806d9b
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 81 deletions.
6 changes: 1 addition & 5 deletions roles/papermerge/files/config/app.production.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
BINARY_STAPLER = "/opt/app/.venv/bin/stapler"

DBUSER = "dbuser"
DBPASS = "dbpass"
DBHOST = "db"
DBNAME = "dbname"

MEDIA_DIR = "/opt/media"
STATIC_DIR = "/opt/static"
IMPORTER_DIR = "/opt/import"
MEDIA_URL = "/media/"
STATIC_URL = "/static/"

Expand Down
27 changes: 0 additions & 27 deletions roles/papermerge/files/config/worker.production.py

This file was deleted.

91 changes: 42 additions & 49 deletions roles/papermerge/templates/docker-compose.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,57 @@

version: '3.7'

x-backend: &backend
image: papermerge/papermerge:2.1.9
restart: always
security_opt:
- no-new-privileges:true
environment:
- DJANGO_SETTINGS_MODULE=config.settings
- DJANGO_SUPERUSER_PASSWORD={{ papermerge__superuser_password }}
- PAPERMERGE__DATABASE__HOST=db
- PAPERMERGE__DATABASE__NAME=dbname
- PAPERMERGE__DATABASE__PASSWORD=dbpass
- PAPERMERGE__DATABASE__TYPE=postgres
- PAPERMERGE__DATABASE__USER=dbuser
- PAPERMERGE__MAIN__SECRET_KEY={{ papermerge__secret_key }}
- PAPERMERGE__REDIS__HOST=redis
- PAPERMERGE__REDIS__PORT=6379
- PAPERMERGE__SEARCH__PATH=/opt/xapian_index
volumes:
- xapian_index:/opt/xapian_index
- {{ papermerge__import_dir }}:/opt/import
- {{ papermerge__path }}/config/app.production.py:/opt/etc/papermerge.conf.py
- {{ papermerge__path }}/media:/opt/media
services:
app:
image: eugenci/papermerge:2.0
container_name: papermerge_app
restart: always
security_opt:
- no-new-privileges:true
depends_on:
- db
- redis
volumes:
- {{ papermerge__path }}/media:/opt/media
- {{ papermerge__path }}/config/app.production.py:/opt/etc/papermerge.conf.py
environment:
- DJANGO_SETTINGS_MODULE=config.settings.production
- POSTGRES_USER=dbuser
- POSTGRES_PASSWORD=dbpass
- POSTGRES_DB=dbname
- POSTGRES_HOST=db
- POSTGRES_PORT=5432
worker:
<<: *backend
container_name: papermerge_worker
command: worker
networks:
- papermerge-net
backend:
<<: *backend
container_name: papermerge_app
ports:
- '16000:8000'
networks:
- caddy-net

- papermerge-net
db:
image: postgres:12.3
image: postgres:12
container_name: papermerge_db
restart: always
security_opt:
- no-new-privileges:true
volumes:
- postgres_data:/var/lib/postgresql/data/
environment:
- POSTGRES_USER=dbuser
- POSTGRES_PASSWORD=dbpass
- POSTGRES_DB=dbname
- POSTGRES_PASSWORD=dbpass
- POSTGRES_USER=dbuser
volumes:
- postgres_data:/var/lib/postgresql/data/
networks:
- papermerge-net

redis:
image: redis:6
container_name: papermerge_redis
Expand All @@ -50,33 +62,14 @@ services:
ports:
- 127.0.0.1:6379:6379
volumes:
- redisdata:/data
- redis_data:/data
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- papermerge-net

worker:
image: eugenci/papermerge-worker:2.0
container_name: papermerge_worker
restart: always
security_opt:
- no-new-privileges:true
volumes:
- {{ papermerge__path }}/media:/opt/media
- {{ papermerge__path }}/config/worker.production.py:/opt/etc/papermerge.conf.py
- {{ papermerge__import_dir }}:/opt/import
environment:
- DJANGO_SETTINGS_MODULE=config.settings.production
- POSTGRES_USER=dbuser
- POSTGRES_PASSWORD=dbpass
- POSTGRES_DB=dbname
- POSTGRES_HOST=db
- POSTGRES_PORT=5432
networks:
- papermerge-net

volumes:
postgres_data:
redisdata:
redis_data:
xapian_index:

networks:
papermerge-net:
Expand Down

0 comments on commit a806d9b

Please sign in to comment.