106 lines
3.7 KiB
YAML
106 lines
3.7 KiB
YAML
version: '2'
|
|
|
|
services:
|
|
cron:
|
|
image: nextcloud: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:apache
|
|
dns: # Using Cloudflare DNS
|
|
- 1.1.1.1
|
|
- 1.0.0.1
|
|
environment:
|
|
MYSQL_HOST: mysql
|
|
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}}
|
|
io.rancher.sidekicks: cron
|
|
traefik.enable: true
|
|
### 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}}
|
|
{{- 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}/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: # Using Cloudflare DNS
|
|
- 1.1.1.1
|
|
- 1.0.0.1
|
|
environment:
|
|
MYSQL_DATABASE: nextcloud_db
|
|
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASS}
|
|
MYSQL_USER: nextcloud_user
|
|
MYSQL_PASSWORD: ${DB_USER_PASS}
|
|
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
|
|
- /RancherCattle/${DATA_DIR}/Database:/var/lib/mysql
|
|
{{- if eq .Values.REDIS "true"}}
|
|
redis:
|
|
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}} |