selfhost/nextcloud/docker-compose.yaml

259 lines
7.8 KiB
YAML
Raw Normal View History

2020-11-28 22:51:37 +01:00
services:
web:
2024-03-05 08:04:22 +01:00
image: nginx:stable
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
# healthcheck:
# test: curl -sSf 'http://localhost/status.php' | grep '"installed":true' | grep '"maintenance":false' | grep '"needsDbUpgrade":false' || exit 1
# interval: 5s
# timeout: 3s
2020-11-28 22:51:37 +01:00
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"
2023-03-29 13:53:45 +02:00
- "traefik.http.middlewares.nextcloudHeader.headers.customResponseHeaders.X-Robots-Tag=noindex,nofollow"
2020-11-28 22:51:37 +01:00
- "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:
image: nextcloud:${NC_MAIN_VERSION}-fpm-own
2023-11-02 13:07:28 +01:00
build:
context: ./
args:
- NC_MAIN_VERSION=${NC_MAIN_VERSION}
2020-11-28 22:51:37 +01:00
volumes:
- ${VOLUMES_PATH}/nextcloud/html:/var/www/html
- ${VOLUMES_PATH}/nextcloud/data:/var/www/html/data
- type: tmpfs
target: /tmp
2020-11-28 22:51:37 +01:00
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"
2023-11-02 13:07:28 +01:00
2021-11-24 15:36:30 +01:00
cron:
image: nextcloud:${NC_MAIN_VERSION}-fpm-own
build:
context: ./
args:
- NC_MAIN_VERSION=${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
2021-11-24 15:36:30 +01:00
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
2023-03-29 13:53:45 +02:00
# notify_push aka Client Push aka High Performance Back-end for Nextcloud File
# https://nextcloud.com/blog/nextcloud-faster-than-ever-introducing-files-high-performance-back-end/
push:
image: nextcloud:${NC_MAIN_VERSION}-fpm
restart: unless-stopped
networks:
- web
- nextcloud
volumes:
- ${VOLUMES_PATH}/nextcloud/html:/var/www/html:ro
- ${VOLUMES_PATH}/nextcloud/data:/var/www/html/data:ro
2023-03-29 13:53:45 +02:00
environment:
- PORT=7867
- NEXTCLOUD_URL=http://web
entrypoint: /var/www/html/custom_apps/notify_push/bin/x86_64/notify_push /var/www/html/config/config.php
labels:
- "traefik.enable=true"
- "traefik.http.routers.ncpush.rule=Host(`cloud.${DOMAIN}`) && PathPrefix(`/push`)"
- "traefik.http.routers.ncpush.entrypoints=websecure"
- "traefik.http.routers.ncpush.tls.certresolver=netcup"
- "traefik.http.routers.ncpush.tls.options=intermediate@file"
- "traefik.http.services.ncpush.loadbalancer.server.port=7867"
- "traefik.http.routers.ncpush.middlewares=ncpushstrip"
- "traefik.http.middlewares.ncpushstrip.stripprefix.prefixes=/push"
- "docker.group=proxy"
2020-11-28 22:51:37 +01:00
db:
image: mariadb:${MARIADB_VERSION}
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
2020-11-28 22:51:37 +01:00
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}
2023-06-09 08:58:54 +02:00
- MARIADB_AUTO_UPGRADE=1
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
2023-06-09 08:58:54 +02:00
healthcheck:
2023-11-02 14:09:36 +01:00
test: ["CMD", "mysqladmin" ,"--user" ,"$MYSQL_USER" ,"--password=$MYSQL_PASSWORD" ,"ping" ,"-h" ,"localhost"]
2023-06-09 08:58:54 +02:00
interval: 20s
timeout: 3s
2023-11-02 13:07:28 +01:00
labels:
- "docker.group=netxtcloud"
2020-11-28 22:51:37 +01:00
2021-11-24 15:36:30 +01: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"
2022-09-09 10:50:42 +02:00
2020-11-28 22:51:37 +01:00
redis:
image: redis:7.2.4
2020-11-28 22:51:37 +01:00
restart: unless-stopped
command: redis-server --requirepass ${REDIS_HOST_PASSWORD}
networks:
- nextcloud
- monitoring
2020-11-28 22:51:37 +01:00
volumes:
- ${VOLUMES_PATH}/nextcloud/redis:/data
2023-06-09 08:58:54 +02:00
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
2023-11-02 13:07:28 +01:00
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
2023-11-02 13:07:28 +01:00
volumes:
- /etc/timezone:/etc/timezone
- /etc/localtime:/etc/localtime
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
2023-01-09 09:33:18 +01:00
drawio-export:
image: jgraph/export-server
expose:
- "8000"
networks:
- nextcloud
volumes:
2023-11-02 13:07:28 +01:00
- ${VOLUMES_PATH}/nextcloud/fonts:/usr/share/fonts/drawio
2023-01-09 09:33:18 +01:00
restart: unless-stopped
labels:
- "docker.group=netxtcloud"
drawio:
image: jgraph/drawio
networks:
- web
- nextcloud
depends_on:
- drawio-export
environment:
- VIRTUAL_HOST=drawio.${DOMAIN}
- VIRTUAL_PORT=8080
- LETS_ENCRYPT_ENABLED=false
- EXPORT_URL=http://drawio-export:8000/
restart: unless-stopped
healthcheck:
test: curl -f http://localhost:8080 || exit 1
interval: 1m30s
timeout: 10s
retries: 5
start_period: 20s
2023-01-09 09:33:18 +01:00
labels:
- "traefik.enable=true"
- "traefik.http.routers.drawio.rule=Host(`drawio.${DOMAIN}`)"
- "traefik.http.routers.drawio.entrypoints=websecure"
- "traefik.http.routers.drawio.tls.certresolver=netcup"
- "traefik.http.routers.drawio.tls.options=intermediate@file"
- "traefik.http.services.drawio.loadbalancer.server.port=8080"
- "docker.group=netxtcloud"
2020-11-28 22:51:37 +01:00
networks:
web:
external: true
nextcloud:
2023-03-29 13:53:45 +02:00
ipam:
config:
- subnet: 172.153.0.0/16 # necessary for the notify_push <-> nextcloud traffic
2022-09-09 10:50:42 +02:00
mariadb:
monitoring:
external: true