selfhost/nextcloud/docker-compose.yaml

161 lines
4.5 KiB
YAML
Raw Normal View History

2020-11-28 22:51:37 +01:00
version: "3"
services:
web:
image: nginx
2020-11-28 22:51:37 +01:00
depends_on:
- app
volumes:
- ${VOLUMES_PATH}/nextcloud_html:/var/www/html:ro
- $PWD/nginx.conf:/etc/nginx/nginx.conf:ro
2020-11-28 22:51:37 +01:00
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=netcup"
2020-11-28 22:51:37 +01:00
- "traefik.http.routers.nextcloud.tls.options=intermediate@file"
- "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=netxtcloud"
2020-11-28 22:51:37 +01:00
2021-11-24 15:36:30 +01:00
2020-11-28 22:51:37 +01:00
app:
2021-11-24 15:36:30 +01:00
image: nextcloud:${NC_MAIN_VERSION}-fpm
2020-11-28 22:51:37 +01:00
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
2021-04-01 19:20:45 +02:00
labels:
- "docker.group=netxtcloud"
2021-11-24 15:36:30 +01:00
cron:
image: nextcloud:${NC_MAIN_VERSION}
2021-11-24 15:36:30 +01:00
restart: unless-stopped
networks:
- nextcloud
volumes:
- ${VOLUMES_PATH}/nextcloud_html:/var/www/html
- ${VOLUMES_PATH}/nextcloud_data:/var/www/html/data
- $PWD/crontab:/var/spool/cron/crontabs/www-data:ro
entrypoint: /cron.sh
depends_on:
- db
- redis
labels:
- "docker.group=netxtcloud"
2021-04-01 19:20:45 +02:00
2020-11-28 22:51:37 +01:00
db:
image: mariadb:10
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW --skip-innodb-read-only-compressed
2020-11-28 22:51:37 +01:00
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}
2022-09-09 10:50:42 +02:00
logging:
driver: "json-file"
options:
max-size: "200k"
max-file: "5"
2020-11-28 22:51:37 +01:00
networks:
- nextcloud
2022-09-09 10:50:42 +02:00
- mariadb
labels:
- "docker.group=netxtcloud"
2020-11-28 22:51:37 +01:00
2021-11-24 15:36:30 +01:00
2022-09-09 10:50:42 +02:00
adminer:
image: adminer
restart: unless-stopped
networks:
- web
- mariadb
environment:
- ADMINER_DEFAULT_SERVER=db
- ADMINER_DESIGN=flat
depends_on:
- db
labels:
- "traefik.enable=true"
- "traefik.http.routers.adminer.rule=Host(`adminer.${DOMAIN}`)"
- "traefik.http.routers.adminer.entrypoints=websecure"
- "traefik.http.routers.adminer.tls.certresolver=netcup"
- "traefik.http.routers.adminer.tls.options=intermediate@file"
- "traefik.http.routers.adminer.middlewares=adminerauth"
- "traefik.http.middlewares.adminerauth.basicauth.users=${HTPASSWD_ADMINER}"
- "docker.group=netxtcloud"
2020-11-28 22:51:37 +01:00
redis:
image: redis:alpine
restart: unless-stopped
command: redis-server --requirepass ${REDIS_HOST_PASSWORD}
networks:
- nextcloud
volumes:
- ${VOLUMES_PATH}/nextcloud_redis:/data
labels:
- "docker.group=netxtcloud"
2020-11-28 22:51:37 +01:00
collabora:
image: collabora/code
2020-11-28 22:51:37 +01:00
networks:
- nextcloud
- web
cap_add:
- MKNOD
2020-11-28 22:51:37 +01:00
expose:
- 9980
environment:
- domain=cloud.${DOMAIN}
- username=${COLLABORA_ADMIN_USER}
- password=${COLLABORA_ADMIN_PASSWORD}
- "extra_params=--o:ssl.enable=false --o:ssl.termination=true"
restart: unless-stopped
2020-11-28 22:51:37 +01:00
labels:
- "traefik.enable=true"
- "traefik.http.routers.collabora.rule=Host(`collabora.${DOMAIN}`)"
- "traefik.http.routers.collabora.entrypoints=websecure"
- "traefik.http.routers.collabora.tls.certresolver=netcup"
- "traefik.http.routers.collabora.tls.options=intermediate@file"
- "traefik.http.services.collabora.loadbalancer.server.port=9980"
- "docker.group=netxtcloud"
2020-11-28 22:51:37 +01:00
networks:
web:
external: true
nextcloud:
2022-09-09 10:50:42 +02:00
mariadb: