Merge branch 'develop/nextcloud'

# Conflicts:
#	templates/Nextcloud/0/docker-compose.yml
This commit is contained in:
WilliamMiceli
2019-01-11 21:55:14 -05:00
3 changed files with 66 additions and 47 deletions

View File

@@ -1,60 +1,78 @@
version: '2'
services:
# cron:
# image: nextcloud:stable-apache
# dns: # Using Cloudflare DNS
# - 1.1.1.1
# - 1.0.0.1
# entrypoint: | # www-data uid: 82
# sh -c 'sh -s <<EOF
# trap "break;exit" SIGHUP SIGINT SIGTERM
# while /bin/true; do
# su -s "/bin/sh" -c "/usr/local/bin/php /var/www/html/cron.php" www-data
# echo $$(date) - Running cron finished
# sleep 900
# done
# EOF'
# restart: on-failure
# user: "www-data"
# volumes_from:
# - nginx
nextcloud:
image: nextcloud:stable-apache
dns:
dns: # Using Cloudflare DNS
- 1.1.1.1
- 1.0.0.1
environment:
MYSQL_HOST: mysql
MYSQL_DATABASE: nextcloud
MYSQL_DATABASE: nextcloud_db
MYSQL_USER: nextcloud_user
MYSQL_PASSWORD: ${DB_USER_PASS}
NEXTCLOUD_ADMIN_USER: ${NC_ADMIN}
NEXTCLOUD_ADMIN_PASSWORD: ${NC_ADMIN_PASS}
NEXTCLOUD_TRUSTED_DOMAINS: ${TRAEFIK_HOST}
labels:
io.rancher.container.pull_image: always
{{- if .Values.HOST_LABEL}}
io.rancher.scheduler.affinity:host_label: ${HOST_LABEL}
{{- end}}
{{- if .Values.TRAEFIK_HOST}}
# io.rancher.sidekicks: cron
traefik.enable: true
### Start Web Segment
traefik.frontend.entryPoints: http,https
traefik.frontend.headers.forceSTSHeader: true
traefik.frontend.headers.referrerPolicy: no-referrer
traefik.frontend.headers.SSLRedirect: true
traefik.frontend.headers.STSPreload: true
traefik.frontend.headers.STSSeconds: 15552000
traefik.frontend.rule: Host:${TRAEFIK_HOST}
traefik.port: "80"
### End Web Segment
{{- else}}
traefik.enable: false
{{- end}}
### Start Nextcloud Segment
traefik.nextcloud.frontend.entryPoints: http,https
traefik.nextcloud.frontend.headers.forceSTSHeader: true
traefik.nextcloud.frontend.headers.referrerPolicy: no-referrer # Security enhancement (Prevents leaking of referer information)
traefik.nextcloud.frontend.headers.SSLRedirect: true
traefik.nextcloud.frontend.headers.STSPreload: true
traefik.nextcloud.frontend.headers.STSSeconds: 15552000
traefik.nextcloud.frontend.rule: Host:${TRAEFIK_HOST}
traefik.nextcloud.port: "80"
### End Nextcloud Segment
links:
- mysql
{{- if eq .Values.REDIS "true"}}
- redis
{{- end}}
networks:
- public-proxy
{{- if .Values.WEB_PORT}}
ports:
- "${WEB_PORT}:80"
{{- end}}
restart: on-failure
volumes:
- /etc/localtime:/etc/localtime:ro # Syncronize time of container with the host system
- /etc/timezone:/etc/timezone:ro # Syncronize timezone of container with the host system
- /RancherCattle/${DATA_DIR}/Application:/var/www/html
- /RancherCattle/${DATA_DIR}/UserData:/var/www/html/data
- /RancherCattle/${DATA_DIR}/Apps:/var/www/html/custom_apps # Nextcloud apps
- /RancherCattle/${DATA_DIR}/Configuration:/var/www/html/config # Nextcloud configuration files
- /RancherCattle/${DATA_DIR}/Nextcloud:/var/www/html # Nextcloud site
- /RancherCattle/${DATA_DIR}/UserData:/var/www/html/data # Users' data file
mysql:
image: mysql:5
dns:
dns: # Using Cloudflare DNS
- 1.1.1.1
- 1.0.0.1
environment:
MYSQL_DATABASE: nextcloud
MYSQL_DATABASE: nextcloud_db
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASS}
MYSQL_USER: nextcloud_user
MYSQL_PASSWORD: ${DB_USER_PASS}
@@ -63,6 +81,7 @@ services:
{{- if .Values.HOST_LABEL}}
io.rancher.scheduler.affinity:host_label: ${HOST_LABEL}
{{- end}}
traefik.enable: false
restart: on-failure
volumes:
- /etc/localtime:/etc/localtime:ro # Syncronize time of container with the host system
@@ -70,17 +89,18 @@ services:
- /RancherCattle/${DATA_DIR}/Database:/var/lib/mysql
{{- if eq .Values.REDIS "true"}}
redis:
image: redis:latest
dns:
image: redis:alpine
dns: # Using Cloudflare DNS
- 1.1.1.1
- 1.0.0.1
labels:
io.rancher.container.pull_image: always
{{- if .Values.HOST_LABEL}}
io.rancher.scheduler.affinity:host_label: ${HOST_LABEL}
{{- end}}
traefik.enable: false
restart: on-failure
volumes:
- /etc/localtime:/etc/localtime:ro # Syncronize time of container with the host system
- /etc/timezone:/etc/timezone:ro # Syncronize timezone of container with the host system
{{- end}}
networks:
public-proxy:
external: true