services: postgres: image: postgres:17-alpine restart: always volumes: - ./postgres:/var/lib/postgresql/data environment: - POSTGRES_DB=nextcloud - POSTGRES_USER=nextcloud - POSTGRES_PASSWORD=XYS22mtSXE5BSP9icaPxFZqw networks: - nextcloud-net healthcheck: # Prüft, ob die DB wirklich bereit ist test: ["CMD-SHELL", "pg_isready -U nextcloud"] interval: 10s timeout: 5s retries: 5 valkey: image: valkey/valkey:8-alpine restart: always mem_limit: 2g command: valkey-server --requirepass 6dfK8X6upA4LmSerMlp11YKW --appendonly yes environment: - REDIS_DISABLE_COMMANDS=FLUSHDB,FLUSHALL volumes: - ./valkey:/data networks: - nextcloud-net app: container_name: nextcloud image: nextcloud:32 restart: unless-stopped mem_limit: 4g ports: - 8080:80 depends_on: postgres: condition: service_healthy # Wartet, bis DB wirklich bereit ist valkey: condition: service_started volumes: - ./nextcloud-data:/var/www/html environment: - POSTGRES_HOST=postgres - POSTGRES_DB=nextcloud - POSTGRES_USER=nextcloud - POSTGRES_PASSWORD=XYS22mtSXE5BSP9icaPxFZqw - REDIS_HOST=valkey - REDIS_HOST_PASSWORD=6dfK8X6upA4LmSerMlp11YKW - PHP_MEMORY_LIMIT=1024M - PHP_UPLOAD_LIMIT=10G networks: - nextcloud-net cron: image: nextcloud:32 container_name: nextcloud-cron restart: always mem_limit: 4g volumes: - ./nextcloud-data:/var/www/html entrypoint: /cron.sh depends_on: - postgres - valkey networks: - nextcloud-net networks: nextcloud-net: driver: bridge