8 Commits

View File

@@ -1,18 +1,23 @@
--- ---
version: "3"
services: services:
nextcloud: nextcloud:
image: nextcloud:${NC_VERSION} image: nextcloud:${NC_VERSION}
restart: unless-stopped restart: unless-stopped
depends_on:
- db
environment: environment:
- MYSQL_HOST=db - MYSQL_HOST=db
- MYSQL_DATABASE=${NC_DATABASE_NAME} - MYSQL_DATABASE=${NC_DATABASE_NAME}
- MYSQL_USER=${NC_DATABASE_USER} - MYSQL_USER=${NC_DATABASE_USER}
- MYSQL_PASSWORD=${NC_DATABASE_PASS} - MYSQL_PASSWORD=${NC_DATABASE_PASS}
- OVERWRITEPROTOCOL=https
labels: labels:
- traefik.enable=${TRAEFIK_ENABLED} - traefik.enable=${TRAEFIK_ENABLED}
- traefik.docker.network=traefik - traefik.docker.network=${TRAEFIK_NETWORK}
# specify a custom middleware for nextcloud-specific configuration
- traefik.http.middlewares.nextcloud-redirectregex.redirectRegex.permanent=true
- traefik.http.middlewares.nextcloud-redirectregex.redirectRegex.regex="https://(.*)/.well-known/(card|cal)dav"
- traefik.http.middlewares.nextcloud-redirectregex.redirectRegex.replacement="https://$${1}/remote.php/dav/"
### Section HTTP ### Section HTTP
- traefik.http.routers.http-${TRAEFIK_ROUTER}.entrypoints=http - traefik.http.routers.http-${TRAEFIK_ROUTER}.entrypoints=http
# redirect to HTTPS only # redirect to HTTPS only
@@ -21,6 +26,7 @@ services:
### Section HTTPS ### Section HTTPS
- traefik.http.routers.https-${TRAEFIK_ROUTER}.entrypoints=https - traefik.http.routers.https-${TRAEFIK_ROUTER}.entrypoints=https
# configure the exposed service # configure the exposed service
- traefik.http.routers.https-${TRAEFIK_ROUTER}.middlewares=hsts,nextcloud-redirectregex
- traefik.http.routers.https-${TRAEFIK_ROUTER}.rule=Host(`${TRAEFIK_MATCHRULE}`) - traefik.http.routers.https-${TRAEFIK_ROUTER}.rule=Host(`${TRAEFIK_MATCHRULE}`)
# of course, enable TLS and it's certificate provider # of course, enable TLS and it's certificate provider
- traefik.http.routers.https-${TRAEFIK_ROUTER}.tls=${TRAEFIK_TLSENABLED} - traefik.http.routers.https-${TRAEFIK_ROUTER}.tls=${TRAEFIK_TLSENABLED}