Files
nextcloud-selfhosted/nextcloud/docker-compose.yml
Thomas Gräfenstein 0e0a6ff1eb add trusted proxy, post-install/upgrade hooks, occ docs and admin review
- Add TRUSTED_PROXIES=caddy to fix reverse proxy header warning
- Add post-installation hook: maintenance window, phone region, DB indices, MIME migrations
- Add post-upgrade hook: DB indices and MIME migrations
- Add occ commands section to README
- Add nextcloud-review.md with admin warning fixes

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 16:33:40 +01:00

93 lines
2.3 KiB
YAML

services:
nextcloud:
image: nextcloud:33-apache
container_name: nextcloud
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_started
env_file: .env
environment:
- POSTGRES_HOST=postgres
- REDIS_HOST=redis
- REDIS_HOST_PASSWORD=${REDIS_PASSWORD}
- TRUSTED_PROXIES=caddy
volumes:
- ${DATA_ROOT}/nextcloud/html:/var/www/html
- ${DATA_ROOT}/nextcloud/data:/var/www/html/data
- ./hooks/post-installation.sh:/docker-entrypoint-hooks.d/post-installation/post-installation.sh:ro
- ./hooks/post-upgrade.sh:/docker-entrypoint-hooks.d/post-upgrade/post-upgrade.sh:ro
networks:
- proxy
- nextcloud-internal
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost/status.php"]
interval: 30s
timeout: 10s
retries: 3
postgres:
image: postgres:17-alpine
container_name: nextcloud-postgres
restart: unless-stopped
env_file: .env
volumes:
- ${DATA_ROOT}/nextcloud/db:/var/lib/postgresql/data
networks:
- nextcloud-internal
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
interval: 10s
timeout: 5s
retries: 5
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
redis:
image: redis:8-alpine
container_name: nextcloud-redis
restart: unless-stopped
command: redis-server --requirepass ${REDIS_PASSWORD}
env_file: .env
networks:
- nextcloud-internal
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
cron:
image: nextcloud:33-apache
container_name: nextcloud-cron
restart: unless-stopped
depends_on:
- nextcloud
entrypoint: /cron.sh
volumes:
- ${DATA_ROOT}/nextcloud/html:/var/www/html
- ${DATA_ROOT}/nextcloud/data:/var/www/html/data
networks:
- nextcloud-internal
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
networks:
proxy:
external: true
nextcloud-internal:
driver: bridge