services/nextcloud/docker-compose.yml

100 lines
2.8 KiB
YAML
Raw Normal View History

2020-09-03 11:42:35 +02:00
version: "3.8"
networks:
default:
name: ${TRAEFIK_NETWORK_NAME}
volumes:
nextcloud:
name: ${NEXTCLOUD_VOLUME_NAME}
nextcloud-postgres:
name: ${POSTGRES_VOLUME_NAME}
services:
2021-02-22 09:58:58 +01:00
nextcloud-web:
container_name: nextcloud-web
build: ./web
restart: always
depends_on:
- nextcloud-fpm
volumes:
- nextcloud:/var/www/html
labels:
traefik.enable: 'true'
traefik.docker.network: ${TRAEFIK_NETWORK_NAME}
traefik.http.routers.nextcloud-fpm.rule: 'Host(`${NEXTCLOUD_DOMAIN}`)'
traefik.http.routers.nextcloud-fpm.entrypoints: 'web'
traefik.http.routers.nextcloud-fpm.middlewares: nextcloud_redirect
2021-04-12 15:55:00 +02:00
traefik.http.middlewares.nextcloud_redirect.redirectregex.regex: /.well-known/(card|cal)dav
traefik.http.middlewares.nextcloud_redirect.redirectregex.replacement: /remote.php/dav/
2021-02-22 09:58:58 +01:00
nextcloud-fpm:
container_name: nextcloud-fpm
image: ${NEXTCLOUD_IMAGE:-nextcloud:21.0.3-fpm-alpine}
2020-09-03 11:42:35 +02:00
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
nextcloud-postgres:
container_name: ${POSTGRES_CONTAINER_NAME}
2021-06-07 17:53:26 +02:00
image: ${POSTGRES_IMAGE:-postgres:12.7-alpine}
2020-09-03 11:42:35 +02:00
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_IMAGE:-redis:6.0.15-alpine}
2020-09-03 11:42:35 +02:00
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:-nextcloud:21.0.3-fpm-alpine}
2020-09-03 11:42:35 +02:00
container_name: nextcloud-cron
restart: always
depends_on:
2021-02-22 09:58:58 +01:00
- nextcloud-web
2020-09-03 11:42:35 +02:00
entrypoint: /cron.sh
environment:
PUID: 1001
PGID: 119
volumes:
- nextcloud:/var/www/html
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro