Merge branch 'develop/nextcloud'
# Conflicts: # templates/Nextcloud/0/docker-compose.yml
This commit is contained in:
@@ -1 +1,14 @@
|
||||
# Nextcloud
|
||||
|
||||
## Pre-Requisites
|
||||
|
||||
* Traefik deployed
|
||||
|
||||
## Useful Tools
|
||||
|
||||
* [Official Security Check](https://scan.nextcloud.com/)
|
||||
|
||||
## To-Do's
|
||||
|
||||
* Explain how to manually setup Redis
|
||||
* Fix Cron container, does not yet properly execute yet
|
||||
@@ -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
|
||||
@@ -20,7 +20,6 @@ catalog:
|
||||
label: "Public Host Domain"
|
||||
description: |
|
||||
The host that Traefik will use to provide public access.
|
||||
Leaving this empty will disable Traefik on this stack.
|
||||
default: "subdomain.domain.tld"
|
||||
required: false
|
||||
type: string
|
||||
@@ -29,8 +28,9 @@ catalog:
|
||||
label: "Web Port"
|
||||
description: |
|
||||
The port to locally access the web interface on.
|
||||
Leaving this empty will disable opening any port on the host system.
|
||||
default: "10100"
|
||||
required: true
|
||||
required: false
|
||||
type: string
|
||||
|
||||
- variable: "DB_ROOT_PASS"
|
||||
@@ -68,7 +68,7 @@ catalog:
|
||||
- variable: "REDIS"
|
||||
label: "Enable Redis"
|
||||
description: |
|
||||
Add a Redis container for memory caching. Must be setup manually.
|
||||
Add a Redis container for memory caching. Additional setup required, see README.
|
||||
default: true
|
||||
required: true
|
||||
type: boolean
|
||||
@@ -80,17 +80,3 @@ catalog:
|
||||
default: "Personal/Nextcloud"
|
||||
required: true
|
||||
type: string
|
||||
|
||||
services:
|
||||
nextcloud:
|
||||
scale: 1
|
||||
# health_check:
|
||||
# port: ${HOST_HTTP_PORT}
|
||||
# request_line: GET /healthcheck HTTP/1.0
|
||||
# interval: 5000
|
||||
# response_timeout: 2000
|
||||
# healthy_threshold: 2
|
||||
# unhealthy_threshold: 3
|
||||
# strategy: none
|
||||
mysql:
|
||||
scale: 1
|
||||
Reference in New Issue
Block a user