services: app: image: nextcloud:34-apache restart: unless-stopped depends_on: db: condition: service_healthy redis: condition: service_healthy environment: &nextcloud_env POSTGRES_HOST: db POSTGRES_DB: nextcloud POSTGRES_USER: nextcloud POSTGRES_PASSWORD: ${DB_PASSWORD} REDIS_HOST: redis # The first start installs Nextcloud with this admin, so no setup page is left open. NEXTCLOUD_ADMIN_USER: admin NEXTCLOUD_ADMIN_PASSWORD: ${ADMIN_PASSWORD} NEXTCLOUD_TRUSTED_DOMAINS: ${HOST} OVERWRITEPROTOCOL: https OVERWRITEHOST: ${HOST} OVERWRITECLIURL: ${URL} # The machine's proxy reaches the container from this range. TRUSTED_PROXIES: 10.192.0.0/10 volumes: - nextcloud:/var/www/html # Runs Nextcloud's background jobs every five minutes. cron: image: nextcloud:34-apache restart: unless-stopped entrypoint: /cron.sh depends_on: db: condition: service_healthy redis: condition: service_healthy environment: *nextcloud_env volumes: - nextcloud:/var/www/html db: image: postgres:18-alpine restart: unless-stopped environment: POSTGRES_DB: nextcloud POSTGRES_USER: nextcloud POSTGRES_PASSWORD: ${DB_PASSWORD} volumes: - db:/var/lib/postgresql healthcheck: test: ["CMD-SHELL", "pg_isready -h 127.0.0.1 -U nextcloud -d nextcloud"] interval: 5s timeout: 5s retries: 12 start_period: 30s redis: image: redis:8-alpine restart: unless-stopped volumes: - redis:/data healthcheck: test: ["CMD-SHELL", "redis-cli ping | grep -q PONG"] interval: 5s timeout: 3s retries: 12 volumes: nextcloud: db: redis: