version: "3.8" networks: default: name: ${TRAEFIK_NETWORK_NAME} volumes: nextcloud: name: ${NEXTCLOUD_VOLUME_NAME} nextcloud-postgres: name: ${POSTGRES_VOLUME_NAME} services: nextcloud: container_name: ${NEXTCLOUD_CONTAINER_NAME} image: ${NEXTCLOUD_IMAGE} restart: always hostname: ${NEXTCLOUD_DOMAIN} depends_on: - nextcloud-postgres - nextcloud-redis volumes: - nextcloud:/var/www/html - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro environment: NEXTCLOUD_TRUSTED_DOMAINS: ${NEXTCLOUD_DOMAIN} NEXTCLOUD_ADMIN_USER: ${NEXTCLOUD_ADMIN_USER} NEXTCLOUD_ADMIN_PASSWORD: ${NEXTCLOUD_ADMIN_PASSWORD} OVERWRITEPROTOCOL: 'https' APACHE_DISABLE_REWRITE_IP: '1' TRUSTED_PROXIES: ${TRAEFIK_NETWORK_NAME} OVERWRITEPROTOCOL: 'https' POSTGRES_HOST: ${POSTGRES_CONTAINER_NAME} POSTGRES_DB: ${POSTGRES_DB} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} POSTGRES_USER: ${POSTGRES_USER} REDIS_HOST: 'nextcloud-redis' PUID: 1001 PGID: 119 labels: traefik.enable: 'true' traefik.docker.network: ${TRAEFIK_NETWORK_NAME} traefik.http.routers.nextcloud.rule: 'Host(`${NEXTCLOUD_DOMAIN}`)' traefik.http.routers.nextcloud.entrypoints: 'web' traefik.http.routers.nextcloud.middlewares: nextcloud_redirect traefik.http.middlewares.nextcloud_redirect.redirectregex.regex: /.well-known/(card|cal)dav traefik.http.middlewares.nextcloud_redirect.redirectregex.replacement: /remote.php/dav/ nextcloud-postgres: container_name: ${POSTGRES_CONTAINER_NAME} image: ${POSTGRES_IMAGE} restart: always environment: POSTGRES_USER: ${POSTGRES_USER} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} POSTGRES_DB: ${POSTGRES_DB} PUID: 1001 PGID: 119 volumes: - nextcloud-postgres:/var/lib/postgresql/data - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro nextcloud-redis: image: redis:6.0.9-alpine container_name: nextcloud-redis restart: always environment: PUID: 1001 PGID: 119 volumes: - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro nextcloud-cron: image: ${NEXTCLOUD_IMAGE} container_name: nextcloud-cron restart: always depends_on: - nextcloud entrypoint: /cron.sh environment: PUID: 1001 PGID: 119 volumes: - nextcloud:/var/www/html - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro