-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
202 lines (188 loc) · 6.47 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
# docker-compose file for running paperless from the docker container registry.
# This file contains everything paperless needs to run.
# Paperless supports amd64, arm and arm64 hardware.
#
# All compose files of paperless configure paperless in the following way:
#
# - Paperless is (re)started on system boot, if it was running before shutdown.
# - Docker volumes for storing data are managed by Docker.
# - Folders for importing and exporting files are created in the same directory
# as this file and mounted to the correct folders inside the container.
# - Paperless listens on port 8000.
#
# In addition to that, this docker-compose file adds the following optional
# configurations:
#
# - Instead of SQLite (default), PostgreSQL is used as the database server.
# - Apache Tika and Gotenberg servers are started with paperless and paperless
# is configured to use these services. These provide support for consuming
# Office documents (Word, Excel, Power Point and their LibreOffice counter-
# parts.
#
# To install and update paperless with this file, do the following:
#
# - Copy this file as 'docker-compose.yml' and the files 'docker-compose.env'
# and '.env' into a folder.
# - Run 'docker-compose pull'.
# - Run 'docker-compose run --rm webserver createsuperuser' to create a user.
# - Run 'docker-compose up -d'.
#
# For more extensive installation and update instructions, refer to the
# documentation.
# Volumes #####################################################################
volumes:
data:
# external: true
# Use this, if using bind mount
# !! Note: Folder (device) needs to exist on the host! Create if it's not there.
# data:
# driver: local
# driver_opts:
# type: none
# o: bind
# device: "${PWD}/data"
media:
# external: true
# Use this, if using bind mount
# !! Note: Folder (device) needs to exist on the host! Create if it's not there.
# media:
# driver: local
# driver_opts:
# type: none
# o: bind
# device: "${PWD}/media"
# !! Note: Folder (device) needs to exist on the host! Create if it's not there.
consume:
driver: local
driver_opts:
type: none
o: bind
device: "${PWD}/consume"
export:
driver: local
driver_opts:
type: none
o: bind
device: "${PWD}/export"
pgdata:
redisdata:
caddy_data:
# Networks #####################################################################
networks:
frontend:
driver: bridge
backend:
driver: bridge
# Services #####################################################################
services:
# Caddy ---------------------------------------------------------------------
caddy:
image: caddy:alpine
restart: unless-stopped
ports:
- 80:80
- 443:443
environment:
TLS_DOMAINS: "${TLS_DOMAINS:?TLS_DOMAINS not set}"
ADMIN_EMAIL: "${ADMIN_EMAIL:?ADMIN_EMAIL not set}"
CADDY_TLS: "${CADDY_TLS}"
networks:
- frontend
- backend
volumes:
- caddy_data:/data
- ./caddy/Caddyfile:/etc/caddy/Caddyfile
logging:
options:
max-size: ${DOCKER_LOGGING_MAX_SIZE:?DOCKER_LOGGING_MAX_SIZE not set}
max-file: ${DOCKER_LOGGING_MAX_FILE:?DOCKER_LOGGING_MAX_FILE not set}
# Broker ---------------------------------------------------------------------
broker:
image: docker.io/library/redis:${REDIS_VERSION:?REDIS_VERSION not set}
restart: unless-stopped
volumes:
- redisdata:/data
networks:
- backend
logging:
options:
max-size: ${DOCKER_LOGGING_MAX_SIZE:?DOCKER_LOGGING_MAX_SIZE not set}
max-file: ${DOCKER_LOGGING_MAX_FILE:?DOCKER_LOGGING_MAX_FILE not set}
# Postgres ------------------------------------------------------------------
db:
image: docker.io/library/postgres:${POSTGRES_VERSION:?POSTGRES_VERSION not set}
restart: unless-stopped
volumes:
- pgdata:/var/lib/postgresql/data
environment:
POSTGRES_DB: paperless
POSTGRES_USER: paperless
POSTGRES_PASSWORD: paperless
networks:
- backend
logging:
options:
max-size: ${DOCKER_LOGGING_MAX_SIZE:?DOCKER_LOGGING_MAX_SIZE not set}
max-file: ${DOCKER_LOGGING_MAX_FILE:?DOCKER_LOGGING_MAX_FILE not set}
# Paperless -----------------------------------------------------------------
webserver:
image: ghcr.io/paperless-ngx/paperless-ngx:${PAPERLESS_NGX_VERSION:?PAPERLESS_NGX_VERSION not set}
restart: unless-stopped
networks:
- backend
depends_on:
- db
- broker
- gotenberg
- tika
# ports:
# - "8000:8000"
healthcheck:
test:
["CMD", "curl", "-fs", "-S", "--max-time", "2", "http://localhost:8000"]
interval: 30s
timeout: 10s
retries: 5
volumes:
- data:/usr/src/paperless/data
- media:/usr/src/paperless/media
- export:/usr/src/paperless/export
- consume:/usr/src/paperless/consume
env_file: docker-compose.env
environment:
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_URL: ${PAPERLESS_URL:?PAPERLESS_URL not set}
logging:
options:
max-size: ${DOCKER_LOGGING_MAX_SIZE:?DOCKER_LOGGING_MAX_SIZE not set}
max-file: ${DOCKER_LOGGING_MAX_FILE:?DOCKER_LOGGING_MAX_FILE not set}
# Gotenberg -----------------------------------------------------------------
gotenberg:
image: docker.io/gotenberg/gotenberg:${GOTENBERG_VERSION:?GOTENBERG_VERSION not set}
restart: unless-stopped
networks:
- backend
# The gotenberg chromium route is used to convert .eml files. We do not
# want to allow external content like tracking pixels or even javascript.
command:
- "gotenberg"
- "--chromium-disable-javascript=true"
- "--chromium-allow-list=file:///tmp/.*"
logging:
options:
max-size: ${DOCKER_LOGGING_MAX_SIZE:?DOCKER_LOGGING_MAX_SIZE not set}
max-file: ${DOCKER_LOGGING_MAX_FILE:?DOCKER_LOGGING_MAX_FILE not set}
# Tika ----------------------------------------------------------------------
tika:
networks:
- backend
image: docker.io/apache/tika:${TKKA_VERSION:?TKKA_VERSION not set}
restart: unless-stopped
logging:
options:
max-size: ${DOCKER_LOGGING_MAX_SIZE:?DOCKER_LOGGING_MAX_SIZE not set}
max-file: ${DOCKER_LOGGING_MAX_FILE:?DOCKER_LOGGING_MAX_FILE not set}