selfhost/nextcloud/docker-compose.yaml

113 lines
3.5 KiB
YAML
Raw Normal View History

2020-11-28 22:51:37 +01:00
version: "3"
services:
web:
#nginx container
build: ./web
depends_on:
- app
volumes:
- ${VOLUMES_PATH}/nextcloud_html:/var/www/html:ro
restart: unless-stopped
networks:
- web
- nextcloud
labels:
- "traefik.enable=true"
- "traefik.http.routers.nextcloud.rule=Host(`cloud.${DOMAIN}`)"
- "traefik.http.routers.nextcloud.entrypoints=websecure"
- "traefik.http.routers.nextcloud.tls.certresolver=myresolver"
- "traefik.http.routers.nextcloud.tls.options=intermediate@file"
- "traefik.docker.network=web"
- "traefik.http.middlewares.nextcloudHeader.headers.customRequestHeaders.X-Forwarded-Proto=https"
- "traefik.http.middlewares.nextcloudHeader.headers.stsSeconds=15552000"
- "traefik.http.middlewares.nextcloudHeader.headers.stsIncludeSubdomains=true"
- "traefik.http.middlewares.nextcloudHeader.headers.stsPreload=true"
- "traefik.http.middlewares.nextcloudHeader.headers.forceSTSHeader=true"
- "traefik.http.routers.nextcloud.middlewares=nextcloudHeader"
- "docker.group=nextcloud"
app:
image: nextcloud:20-fpm
volumes:
- ${VOLUMES_PATH}/nextcloud_html:/var/www/html
- ${VOLUMES_PATH}/nextcloud_data:/var/www/html/data
restart: unless-stopped
networks:
- nextcloud
environment:
- NEXTCLOUD_TRUSTED_DOMAINS=${NEXTCLOUD_TRUSTED_DOMAINS}
- MYSQL_HOST=db
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_USER=${MYSQL_USER}
- REDIS_HOST=redis
- REDIS_HOST_PASSWORD=${REDIS_HOST_PASSWORD}
depends_on:
- db
- redis
db:
image: mariadb:10
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
volumes:
- ${VOLUMES_PATH}/nextcloud_db:/var/lib/mysql
restart: unless-stopped
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/Berlin
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_USER=${MYSQL_USER}
networks:
- nextcloud
redis:
image: redis:alpine
restart: unless-stopped
command: redis-server --requirepass ${REDIS_HOST_PASSWORD}
networks:
- nextcloud
volumes:
- ${VOLUMES_PATH}/nextcloud_redis:/data
office:
image: onlyoffice/documentserver:latest
stdin_open: true
tty: true
restart: unless-stopped
networks:
- nextcloud
- web
expose:
- '80'
- '443'
volumes:
- ${VOLUMES_PATH}/nextcloud_documents:/var/www/onlyoffice/Data
# - ${VOLUMES_PATH}/onlyoffice_log:/var/log/onlyoffice
labels:
- "traefik.enable=true"
- "traefik.http.routers.office.rule=Host(`office.${DOMAIN}`)"
- "traefik.http.routers.office.entrypoints=websecure"
- "traefik.http.routers.office.tls.certresolver=myresolver"
- "traefik.http.routers.office.tls.options=intermediate@file"
- "traefik.docker.network=web"
- "traefik.http.middlewares.officeHeader.headers.customRequestHeaders.X-Forwarded-Proto=https"
- "traefik.http.middlewares.officeHeader.headers.stsSeconds=15552000"
- "traefik.http.middlewares.officeHeader.headers.stsIncludeSubdomains=true"
- "traefik.http.middlewares.officeHeader.headers.stsPreload=true"
- "traefik.http.middlewares.officeHeader.headers.forceSTSHeader=true"
- "traefik.http.routers.office.middlewares=officeHeader"
- "docker.group=nextcloud"
networks:
web:
external: true
nextcloud:
external: false