This repository has been archived by the owner on Oct 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnextcloud.yml
90 lines (85 loc) · 3.11 KB
/
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
version: '3.7'
services:
nginx:
image: ethibox/nginx-proxy:latest
command:
- /bin/sh
- -c
- |
cp /etc/nginx/nginx-nextcloud.conf /etc/nginx/nginx.conf
sed -i -e 's/app:9000/'$$STACK_NAME'_app:9000/g' /etc/nginx/nginx.conf
nginx -g 'daemon off;'
environment:
- STACK_NAME={{ index .Service.Labels "com.docker.stack.namespace" }}
volumes:
- ${VOLUME_PATH}nextcloud:/var/www/html:cached
deploy:
labels:
traefik.enable: "true"
traefik.port: 80
traefik.frontend.rule: Host:${DOMAIN:-nextcloud.localhost}
traefik.frontend.headers.customResponseHeaders: "X-Frame-Options: SAMEORIGIN||Strict-Transport-Security: max-age=31536000||Referrer-Policy: no-referrer"
traefik.frontend.redirect.permanent: "true"
traefik.frontend.redirect.regex: https://(.*)/.well-known/(card|cal)dav
traefik.frontend.redirect.replacement: https://$$1/remote.php/dav/
networks:
- internal
- traefik
app:
image: nextcloud:${VERSION:-18.0.4-fpm-alpine}
command:
- /bin/sh
- -c
- |
sleep 10
apk add --no-cache sudo
sudo -u www-data php occ --no-warnings db:add-missing-indices
sudo -u www-data php occ --no-warnings db:convert-filecache-bigint
sudo -u www-data php occ --no-warnings config:system:set trusted_proxies 0 --value="172.xx.0.x"
sudo -u www-data php occ --no-warnings config:system:set overwriteprotocol --value="${SCHEME:-http}"
sudo -u www-data php occ --no-warnings config:system:set overwrite.cli.url --value="${SCHEME:-http}://${DOMAIN:-nextcloud.localhost}"
mkdir -p config && wget -O config/objectstore.config.php https://github.com/ethibox/stacks/raw/master/configs/objectstore.config.php
php-fpm
environment:
- MYSQL_HOST=mariadb
- MYSQL_DATABASE=${MYSQL_DATABASE:-nextcloud}
- MYSQL_USER=${MYSQL_USER:-nextcloud}
- MYSQL_PASSWORD=${MYSQL_PASSWORD:-myp@ssw0rd}
- NEXTCLOUD_TRUSTED_DOMAINS=${DOMAIN:-nextcloud.localhost} nginx ${TRUSTED_DOMAINS}
- NEXTCLOUD_UPDATE=${NEXTCLOUD_UPDATE:-1}
- ENABLE_S3=${ENABLE_S3:-false}
- S3_BUCKET=${S3_BUCKET}
- S3_KEY=${S3_KEY}
- S3_SECRET=${S3_SECRET}
- S3_REGION=${S3_REGION}
- S3_HOSTNAME=${S3_HOSTNAME}
- S3_PORT=${S3_PORT:-443}
- S3_USE_SSL=${S3_USE_SSL:-true}
- S3_AUTOCREATE=${S3_AUTOCREATE:-true}
- S3_USE_PATH_STYLE=${S3_USE_PATH_STYLE:-true}
- S3_OBJECT_PREFIX=${S3_OBJECT_PREFIX:-urn:oid:}
volumes:
- ${VOLUME_PATH}nextcloud:/var/www/html:cached
networks:
- internal
mariadb:
image: mariadb:10.3.12
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-myp@ssw0rd}
- MYSQL_USER=${MYSQL_USER:-nextcloud}
- MYSQL_DATABASE=${MYSQL_DATABASE:-nextcloud}
- MYSQL_PASSWORD=${MYSQL_PASSWORD:-myp@ssw0rd}
volumes:
- ${VOLUME_PATH}mariadb:/var/lib/mysql
networks:
- internal
volumes:
nextcloud:
mariadb:
networks:
internal:
driver: overlay
attachable: true
traefik:
external: true
name: traefik-net