2020-05-10 00:33:17 +02:00
|
|
|
|
2020-05-10 12:47:40 +02:00
|
|
|
# Create netxcloud network first
|
2020-05-10 00:33:17 +02:00
|
|
|
# docker network create nextcloud
|
|
|
|
#NOTES:
|
|
|
|
#1. certificatesresolvers.myresolver.acme.email=myemail@gmail.com
|
2020-05-10 12:47:40 +02:00
|
|
|
#2. TRUSTED_PROXIES values based on your 'traefik docker network run docker network inspect traefik' to see the network
|
2020-05-10 00:33:17 +02:00
|
|
|
#3. remove traefik.http.middlewares.nextcloud.headers.contentSecurityPolicy and
|
|
|
|
#traefik.http.middlewares.nextcloud.headers.customFrameOptionsValue if you don't want to allow iframe your domain
|
|
|
|
# cat docker-compose.yml
|
|
|
|
|
2020-05-10 12:47:40 +02:00
|
|
|
version: '3.3'
|
2020-05-10 00:33:17 +02:00
|
|
|
|
|
|
|
volumes:
|
|
|
|
nextcloud-www:
|
|
|
|
driver: local
|
|
|
|
nextcloud-db:
|
|
|
|
driver: local
|
|
|
|
redis:
|
|
|
|
driver: local
|
|
|
|
|
|
|
|
|
|
|
|
services:
|
|
|
|
|
|
|
|
db:
|
|
|
|
restart: always
|
|
|
|
image: postgres:11
|
|
|
|
networks:
|
|
|
|
- nextcloud
|
|
|
|
environment:
|
|
|
|
- POSTGRES_USER=nextcloud
|
|
|
|
- POSTGRES_PASSWORD=password
|
|
|
|
- POSTGRES_DB=nextcloud
|
|
|
|
volumes:
|
|
|
|
- nextcloud-db:/var/lib/postgresql/data
|
|
|
|
redis:
|
|
|
|
image: redis:latest
|
|
|
|
restart: always
|
|
|
|
networks:
|
|
|
|
- nextcloud
|
|
|
|
volumes:
|
|
|
|
- redis:/var/lib/redis
|
|
|
|
|
|
|
|
nextcloud:
|
|
|
|
image: nextcloud:latest
|
|
|
|
restart: always
|
|
|
|
networks:
|
2020-05-10 12:47:40 +02:00
|
|
|
- default
|
2020-05-10 00:33:17 +02:00
|
|
|
- nextcloud
|
|
|
|
depends_on:
|
|
|
|
- redis
|
|
|
|
- db
|
|
|
|
labels:
|
|
|
|
- traefik.http.routers.nextcloud.middlewares=nextcloud,nextcloud_redirect
|
|
|
|
- traefik.http.routers.nextcloud.tls.certresolver=myresolver
|
|
|
|
- traefik.http.routers.nextcloud.rule=Host(`nextcloud.mydomain.com`)
|
|
|
|
- traefik.http.middlewares.nextcloud.headers.customFrameOptionsValue=ALLOW-FROM https://mydomain.com
|
|
|
|
- traefik.http.middlewares.nextcloud.headers.contentSecurityPolicy=frame-ancestors 'self' mydomain.com *.mydomain.net
|
|
|
|
- traefik.http.middlewares.nextcloud.headers.stsSeconds=155520011
|
|
|
|
- traefik.http.middlewares.nextcloud.headers.stsIncludeSubdomains=true
|
|
|
|
- traefik.http.middlewares.nextcloud.headers.stsPreload=true
|
|
|
|
- traefik.http.middlewares.nextcloud_redirect.redirectregex.regex=/.well-known/(card|cal)dav
|
|
|
|
- traefik.http.middlewares.nextcloud_redirect.redirectregex.replacement=/remote.php/dav/
|
|
|
|
environment:
|
|
|
|
- POSTGRES_DB=nextcloud
|
|
|
|
- POSTGRES_USER=nextcloud
|
|
|
|
- POSTGRES_PASSWORD=password
|
|
|
|
- POSTGRES_HOST=db
|
|
|
|
- NEXTCLOUD_ADMIN_USER=admin
|
|
|
|
- NEXTCLOUD_ADMIN_PASSWORD=adminpass
|
|
|
|
- REDIS_HOST=redis
|
|
|
|
- NEXTCLOUD_TRUSTED_DOMAINS=nextcloud.mydomain.com
|
2020-05-10 12:47:40 +02:00
|
|
|
- TRUSTED_PROXIES=172.19.0.0/16
|
2020-05-10 00:33:17 +02:00
|
|
|
volumes:
|
|
|
|
- nextcloud-www:/var/www/html
|
|
|
|
|
|
|
|
networks:
|
2020-05-10 12:47:40 +02:00
|
|
|
default:
|
|
|
|
external:
|
|
|
|
name: traefik
|
|
|
|
|
2020-05-10 00:33:17 +02:00
|
|
|
nextcloud:
|
2020-05-10 12:47:40 +02:00
|
|
|
internal: true
|