Files
nextcloud/docker-compose.yml
2025-12-08 02:46:38 +01:00

90 lines
2.3 KiB
YAML

volumes:
nextcloud:
db:
networks:
web:
external: true # gemeinsames Netz mit Caddy
internal:
driver: bridge # nur für Nextcloud-Stack intern
services:
db:
image: mariadb:10.6
restart: unless-stopped
command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_USER=${MYSQL_USER}
volumes:
- ./db:/var/lib/mysql
networks:
- internal
healthcheck:
test: ["CMD-SHELL", "mysqladmin ping -h localhost -p${MYSQL_ROOT_PASSWORD} || exit 1"]
interval: 30s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
restart: unless-stopped
command: ["redis-server", "--requirepass", "${REDIS_PASSWORD}"]
networks:
- internal
healthcheck:
test: ["CMD", "redis-cli", "-a", "${REDIS_PASSWORD}", "PING"]
interval: 30s
timeout: 5s
retries: 5
app:
image: nextcloud:latest
restart: unless-stopped
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
environment:
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_HOST=db
- REDIS_HOST=redis
- REDIS_HOST_PASSWORD=${REDIS_PASSWORD}
- NEXTCLOUD_TRUSTED_DOMAINS=${DOMAIN}
- OVERWRITEPROTOCOL=${OVERWRITEPROTOCOL} # z.B. "https"
- NEXTCLOUD_ADMIN_USER=${NEXTCLOUD_ADMIN_USER}
- NEXTCLOUD_ADMIN_PASSWORD=${NEXTCLOUD_ADMIN_PASSWORD}
- PHP_MEMORY_LIMIT=${PHP_MEMORY_LIMIT}
- PHP_UPLOAD_LIMIT=${PHP_UPLOAD_LIMIT}
volumes:
- ./nextcloud:/var/www/html
networks:
web:
aliases:
- app # <- Caddy erreicht die App als "app:80"
internal:
aliases:
- nextcloud
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://localhost/status.php || exit 1"]
interval: 30s
timeout: 5s
retries: 10
cron:
image: nextcloud:latest
restart: unless-stopped
depends_on:
app:
condition: service_started
entrypoint: /cron.sh
volumes:
- ./nextcloud:/var/www/html
networks:
- internal