open-productive-stack/nextcloud/docker-compose.yml
2026-03-30 11:10:11 +02:00

107 lines
3.4 KiB
YAML

# Nextcloud-Stack
services:
nextcloud:
image: nextcloud:32-fpm
container_name: nextcloud
depends_on:
- nextcloud-redis
environment:
- DOMAIN=${DOMAIN}
- NEXTCLOUD_ADMIN_USER=${NEXTCLOUD_ADMIN_USER:-admin}
- NEXTCLOUD_ADMIN_PASSWORD=${NEXTCLOUD_ADMIN_PASSWORD:-admin}
- NEXTCLOUD_DEFAULT_PHONE_REGION=DE
- NEXTCLOUD_DEFAULT_LANGUAGE=${NEXTCLOUD_DEFAULT_LANGUAGE:-de}
- ONLYOFFICE_JWT_SECRET=${ONLYOFFICE_JWT_SECRET}
- POSTGRES_DB=${NEXTCLOUD_DB_NAME}
- POSTGRES_HOST=${NEXTCLOUD_DB_HOST}
- POSTGRES_PASSWORD=${NEXTCLOUD_DB_PASSWORD}
- POSTGRES_USER=${NEXTCLOUD_DB_USER}
- OVERWRITEPROTOCOL=https
- OVERWRITEHOST=${NEXTCLOUD_DOMAIN}
- REDIS_HOST=nextcloud-redis
- TRUSTED_PROXIES=172.22.0.0/16 172.19.0.0/16
- COLLABORA_DOMAIN=${COLLABORA_DOMAIN}
labels:
- "traefik.enable=false"
volumes:
- nextcloud-data:/var/www/html
- ./hooks/post-installation:/docker-entrypoint-hooks.d/post-installation
expose:
- 80
- 9000
networks:
- nextcloud
- traefik
- database
restart: unless-stopped
nextcloud-reverse-proxy:
container_name: nextcloud-reverse-proxy
image: nginx:1.27
depends_on:
- nextcloud
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik"
- "traefik.http.routers.nextcloud-reverse-proxy.rule=Host(`${NEXTCLOUD_DOMAIN}`)"
- "traefik.http.routers.nextcloud-reverse-proxy.entrypoints=web,websecure"
- "traefik.http.routers.nextcloud-reverse-proxy.middlewares=https-redirect"
- "traefik.http.routers.nextcloud-reverse-proxy.tls=true"
- "traefik.http.routers.nextcloud-reverse-proxy.tls.certresolver=le"
- "traefik.http.services.nextcloud-reverse-proxy.loadbalancer.server.port=80"
volumes:
- ./reverse-proxy/nginx.conf:/etc/nginx/nginx.conf
- nextcloud-data:/var/www/html
networks:
- nextcloud
- traefik
restart: unless-stopped
nextcloud-redis:
image: redis:alpine
container_name: nextcloud-redis
networks:
- nextcloud
restart: unless-stopped
collabora:
image: collabora/code:latest
container_name: nextcloud-collabora
environment:
- domain=${NEXTCLOUD_DOMAIN}
- aliasgroup1=https://${NEXTCLOUD_DOMAIN}:443
- username=${COLLABORA_USERNAME}
- password=${COLLABORA_PASSWORD}
- extra_params=--o:ssl.enable=false --o:ssl.termination=true --o:welcome.enable=false --o:logging.level=warning
- dictionaries=de_DE en_GB en_US
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik"
- "traefik.http.routers.collabora.rule=Host(`${COLLABORA_DOMAIN}`)"
- "traefik.http.routers.collabora.entrypoints=web,websecure"
- "traefik.http.routers.collabora.middlewares=https-redirect"
- "traefik.http.routers.collabora.tls=true"
- "traefik.http.routers.collabora.tls.certresolver=le"
- "traefik.http.services.collabora.loadbalancer.server.port=9980"
- "traefik.http.services.collabora.loadbalancer.server.scheme=http"
networks:
- nextcloud
- traefik
restart: unless-stopped
cap_add:
- MKNOD
- SYS_ADMIN
security_opt:
- apparmor:unconfined
volumes:
nextcloud-data:
name: nextcloud-data
networks:
database:
external: true
nextcloud:
external: true
traefik:
external: true