-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-for-heavymetal-nextcloud.yml
278 lines (271 loc) · 12.8 KB
/
docker-compose-for-heavymetal-nextcloud.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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
version: "3.9"
name: heavymetal-services
networks:
networks_traefik_proxy:
external: true
nextcloud:
driver: bridge
nextcloud-private:
driver: bridge
services:
imaginary:
image: nextcloud/aio-imaginary:latest
command: -concurrency 6 -enable-url-source
container_name: "imaginary"
user: ${UID}:${GID}
restart: unless-stopped
environment:
PORT: 9000
MALLOC_ARENA_MAX: 2
expose:
- "9000"
networks:
- nextcloud
- nextcloud-private
labels:
- dev.dozzle.group=nextcloud
redis:
image: redis:6
container_name: "redis"
restart: unless-stopped
user: ${UID}:${GID}
volumes:
- ${DATA_STORAGE}/redis:/data
environment:
- ALLOW_EMPTY_PASSWORD=yes
networks:
- nextcloud
- nextcloud-private
healthcheck:
test: redis-cli ping || exit 1
interval: 10s
timeout: 5s
retries: 10
labels:
- dev.dozzle.group=nextcloud
nextcloud-db:
image: mariadb
container_name: "nextcloud-db"
restart: unless-stopped
user: ${UID}:${GID}
networks:
- nextcloud
expose:
- "3306"
command: --verbose --transaction-isolation=READ-COMMITTED --binlog-format=ROW --innodb-file-per-table=1 --skip-innodb-read-only-compressed
volumes:
- ${NEXTCLOUD_DATA}/db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=${NEXTCLOUD_ROOT_PASSWORD}
- MYSQL_PASSWORD=${NEXTCLOUD_PASSWORD}
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud-user
labels:
- dev.dozzle.group=nextcloud
nextcloud:
image: jhnrn/nextcloud-linux
container_name: nextcloud
hostname: nextcloud
restart: unless-stopped
links:
- nextcloud-db
volumes:
- ${NEXTCLOUD_DATA}/html:/var/www/html
- ${NEXTCLOUD_DATA}/data:/var/www/html/data
- ${NEXTCLOUD_DATA}/tmp/app:/tmp
- ${NEXTCLOUD_DATA}/php/conf.d:/usr/local/etc/php/conf.d
user: ${UID}:${GID}
group_add:
- "${RENDER_GROUP_ID}" # Change this to match your "render" host group id (getent group render)
- "${VIDEO_GROUP_ID}" # Change this to match your "video" host group id (getent group video)
devices:
- /dev/dri/renderD128:/dev/dri/renderD128
# - /dev/kfd:/dev/kfd # Remove this device if you don't use the OpenCL tone-mapping
environment:
- MYSQL_PASSWORD=${NEXTCLOUD_PASSWORD}
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud-user
- MYSQL_HOST=nextcloud-db
- NEXTCLOUD_TRUSTED_DOMAINS=nextcloud.${DOMAIN}
- REDIS_HOST=redis
- NEXTCLOUD_HOSTNAME=${NEXTCLOUD_HOSTNAME}
- NEXTCLOUD_ADMIN_USER=${NEXTCLOUD_ADMIN_USER}
- NEXTCLOUD_ADMIN_PASSWORD=${NEXTCLOUD_ADMIN_PASSWORD}
- OVERWRITEPROTOCOL=https
- OVERWRITECLIURL=https://nextcloud.${DOMAIN}
- OVERWRITEHOST=nextcloud.${DOMAIN}
- PUID=33
- PGID=33
- PHP_MEMORY_LIMIT=8G
- PHP_UPLOAD_LIMIT=20G
networks:
networks_traefik_proxy:
nextcloud:
labels:
- dev.dozzle.group=nextcloud
- ofelia.enabled=true
- ofelia.job-exec.nextcloud_scan.schedule=@every 1h30m
- ofelia.job-exec.nextcloud_scan.user=33
- ofelia.job-exec.nextcloud_scan.command=php occ files:scan --all
- ofelia.job-exec.nextcloud_cron.schedule=@every 5m
- ofelia.job-exec.nextcloud_cron.user=33
- ofelia.job-exec.nextcloud_cron.command=php -f /var/www/html/cron.php
- traefik.enable=true
- traefik.http.routers.nextcloud.rule=Host(`nextcloud.${DOMAIN}`)
- traefik.http.routers.nextcloud.tls.certresolver=certificato
- traefik.http.routers.nextcloud.entrypoints=web,web-secure
- traefik.http.routers.nextcloud.middlewares=quantum_metal-ipallowlist,nextcloud-hsts,nextcloud-redirectregex1,nextcloud-redirectregex2,nextcloud-redirectregex3,nextcloud-redirectregex4
- traefik.http.services.nextcloud.loadbalancer.server.port=80
# traefik.http.middlewares.nextcloud-limit.buffering.maxRequestBodyBytes: 16777216 # 16 GBytes
# traefik.http.middlewares.nextcloud-limit.buffering.memRequestBodyBytes: 16777216 # 16 GBytes
# traefik.http.middlewares.nextcloud-limit.buffering.maxResponseBodyBytes: 16777216 # 16 GBytes
# traefik.http.middlewares.nextcloud-limit.buffering.memResponseBodyBytes: 16777216 # 16 GBytes
- traefik.http.middlewares.nextcloud-redirectregex1.redirectregex.permanent=true
- traefik.http.middlewares.nextcloud-redirectregex1.redirectregex.regex=https?://([^/]*)/.well-known/(card|cal)dav
- traefik.http.middlewares.nextcloud-redirectregex1.redirectregex.replacement=https://$${1}/remote.php/dav
- traefik.http.middlewares.nextcloud-redirectregex2.redirectregex.permanent=true
- traefik.http.middlewares.nextcloud-redirectregex2.redirectregex.regex=https?://([^/]*)/.well-known/webfinger
- traefik.http.middlewares.nextcloud-redirectregex2.redirectregex.replacement=https://$${1}/index.php/.well-known/webfinger/
- traefik.http.middlewares.nextcloud-redirectregex3.redirectregex.permanent=true
- traefik.http.middlewares.nextcloud-redirectregex3.redirectregex.regex=https?://([^/]*)/.well-known/nodeinfo
- traefik.http.middlewares.nextcloud-redirectregex3.redirectregex.replacement=https://$${1}/index.php/.well-known/nodeinfo/
- traefik.http.middlewares.nextcloud-redirectregex4.redirectregex.permanent=true
- traefik.http.middlewares.nextcloud-redirectregex4.redirectregex.regex=https?://([^/]*)(/.well-known[^#]*)
- traefik.http.middlewares.nextcloud-redirectregex4.redirectregex.replacement=https://$${1}/index.php$${2}
- traefik.http.middlewares.nextcloud-hsts.headers.stsSeconds=31536000
- traefik.docker.network=networks_traefik_proxy
- homepage.group=HeavyMetal
- homepage.weight=3000
- homepage.name=Nextcloud
- homepage.description=for Home
- homepage.icon=nextcloud.png
- homepage.href=https://nextcloud.${DOMAIN}/
- homepage.widget.type=nextcloud
- homepage.widget.url=https://nextcloud.${DOMAIN}
# - homepage.widget.username=${NEXTCLOUD_APP_USERNAME}
# - homepage.widget.password=${NEXTCLOUD_APP_PASSWORD}
- homepage.widget.key=${NEXTCLOUD_TOKEN} # You can generate the token with "php occ config:app:set serverinfo token --value yourtoken
# - homepage.widget.fields=["cpuload", "memoryusage", "freespace", "activeusers"]
depends_on:
nextcloud-db:
condition: service_started
redis:
condition: service_healthy
healthcheck:
test: curl -sSf 'http://localhost/status.php' | grep '"installed":true' | grep '"maintenance":false' | grep '"needsDbUpgrade":false' || exit 1
interval: 10s
timeout: 5s
retries: 10
nextcloud-private-db:
image: mariadb
container_name: "nextcloud-private-db"
restart: unless-stopped
networks:
- nextcloud-private
expose:
- "3306"
command: --verbose --transaction-isolation=READ-COMMITTED --binlog-format=ROW --innodb-file-per-table=1 --skip-innodb-read-only-compressed
volumes:
- ${NEXTCLOUD_PRIVATE_DATA}/db:/var/lib/mysql
user: ${UID}:${GID}
environment:
- MYSQL_ROOT_PASSWORD=${NEXTCLOUD_ROOT_PASSWORD}
- MYSQL_PASSWORD=${NEXTCLOUD_PASSWORD}
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud-private-user
labels:
- dev.dozzle.group=nextcloud-private
nextcloud-private:
image: jhnrn/nextcloud-linux
container_name: nextcloud-private
hostname: nextcloud-private
restart: unless-stopped
links:
- nextcloud-private-db
volumes:
- ${NEXTCLOUD_PRIVATE_DATA}/html:/var/www/html
- ${NEXTCLOUD_PRIVATE_DATA}/data:/var/www/html/data
- ${NEXTCLOUD_PRIVATE_DATA}/tmp/app:/tmp
- ${NEXTCLOUD_PRIVATE_DATA}/php/conf.d:/usr/local/etc/php/conf.d
user: ${UID}:${GID}
group_add:
- "${RENDER_GROUP_ID}" # Change this to match your "render" host group id (getent group render)
- "${VIDEO_GROUP_ID}" # Change this to match your "video" host group id (getent group video)
devices:
- /dev/dri/renderD128:/dev/dri/renderD128
# - /dev/kfd:/dev/kfd # Remove this device if you don't use the OpenCL tone-mapping
environment:
- MYSQL_PASSWORD=${NEXTCLOUD_PASSWORD}
- MYSQL_DATABASE=nextcloud
- MYSQL_USER=nextcloud-private-user
- MYSQL_HOST=nextcloud-private-db
- NEXTCLOUD_TRUSTED_DOMAINS=private.${DOMAIN}
- REDIS_HOST=redis
- NEXTCLOUD_HOSTNAME=nextcloud-private
- NEXTCLOUD_ADMIN_USER=${NEXTCLOUD_ADMIN_USER}
- NEXTCLOUD_ADMIN_PASSWORD=${NEXTCLOUD_ADMIN_PASSWORD}
- OVERWRITEPROTOCOL=https
- OVERWRITECLIURL=https://private.${DOMAIN}
- OVERWRITEHOST=private.${DOMAIN}
- PUID=33
- PGID=33
- PHP_MEMORY_LIMIT=8G
- PHP_UPLOAD_LIMIT=20G
networks:
networks_traefik_proxy:
nextcloud-private:
labels:
- dev.dozzle.group=nextcloud-private
- ofelia.enabled=true
- ofelia.job-exec.nextcloud_private_scan.schedule=@every 1h30m
- ofelia.job-exec.nextcloud_private_scan.user=33
- ofelia.job-exec.nextcloud_private_scan.command=php occ files:scan --all
- ofelia.job-exec.nextcloud_private_cron.schedule=@every 5m
- ofelia.job-exec.nextcloud_private_cron.user=33
- ofelia.job-exec.nextcloud_private_cron.command=php -f /var/www/html/cron.php
- traefik.enable=true
- traefik.http.routers.nextcloud-private.rule=Host(`private.${DOMAIN}`)
- traefik.http.routers.nextcloud-private.tls.certresolver=certificato
- traefik.http.routers.nextcloud-private.entrypoints=web,web-secure
- traefik.http.routers.nextcloud-private.middlewares=private-ipallowlist,nextcloud-private-hsts,nextcloud-private-redirectregex1,nextcloud-private-redirectregex2,nextcloud-private-redirectregex3,nextcloud-private-redirectregex4
- traefik.http.services.nextcloud-private.loadbalancer.server.port=80
# traefik.http.middlewares.nextcloud-private-limit.buffering.maxRequestBodyBytes: 16777216 # 16 GBytes
# traefik.http.middlewares.nextcloud-private-limit.buffering.memRequestBodyBytes: 16777216 # 16 GBytes
# traefik.http.middlewares.nextcloud-private-limit.buffering.maxResponseBodyBytes: 16777216 # 16 GBytes
# traefik.http.middlewares.nextcloud-private-limit.buffering.memResponseBodyBytes: 16777216 # 16 GBytes
- traefik.http.middlewares.nextcloud-private-redirectregex1.redirectregex.permanent=true
- traefik.http.middlewares.nextcloud-private-redirectregex1.redirectregex.regex=https?://([^/]*)/.well-known/(card|cal)dav
- traefik.http.middlewares.nextcloud-private-redirectregex1.redirectregex.replacement=https://$${1}/remote.php/dav
- traefik.http.middlewares.nextcloud-private-redirectregex2.redirectregex.permanent=true
- traefik.http.middlewares.nextcloud-private-redirectregex2.redirectregex.regex=https?://([^/]*)/.well-known/webfinger
- traefik.http.middlewares.nextcloud-private-redirectregex2.redirectregex.replacement=https://$${1}/index.php/.well-known/webfinger/
- traefik.http.middlewares.nextcloud-private-redirectregex3.redirectregex.permanent=true
- traefik.http.middlewares.nextcloud-private-redirectregex3.redirectregex.regex=https?://([^/]*)/.well-known/nodeinfo
- traefik.http.middlewares.nextcloud-private-redirectregex3.redirectregex.replacement=https://$${1}/index.php/.well-known/nodeinfo/
- traefik.http.middlewares.nextcloud-private-redirectregex4.redirectregex.permanent=true
- traefik.http.middlewares.nextcloud-private-redirectregex4.redirectregex.regex=https?://([^/]*)(/.well-known[^#]*)
- traefik.http.middlewares.nextcloud-private-redirectregex4.redirectregex.replacement=https://$${1}/index.php$${2}
- traefik.http.middlewares.nextcloud-private-hsts.headers.stsSeconds=31536000
- traefik.docker.network=networks_traefik_proxy
- homepage.group=HeavyMetal
- homepage.name=Nextcloud (private)
- homepage.weight=4000
- homepage.description=for private
- homepage.icon=nextcloud.png
- homepage.href=https://private.${DOMAIN}
- homepage.widget.type=nextcloud
- homepage.widget.url=https://private.${DOMAIN}
# - homepage.widget.username=${NEXTCLOUD_APP_USERNAME}
# - homepage.widget.password=${NEXTCLOUD_APP_PASSWORD}
- homepage.widget.key=${NEXTCLOUD_PRIVATE_TOKEN} # You can generate the token with "php occ config:app:set serverinfo token --value yourtoken
# - homepage.widget.fields=["cpuload", "memoryusage", "freespace", "activeusers"]
depends_on:
nextcloud-private-db:
condition: service_started
redis:
condition: service_healthy
healthcheck:
test: curl -sSf 'http://localhost/status.php' | grep '"installed":true' | grep '"maintenance":false' | grep '"needsDbUpgrade":false' || exit 1
interval: 10s
timeout: 5s
retries: 10