# /services/nextcloud/compose.yml services: nextcloud: image: nextcloud:31 container_name: nextcloud restart: always depends_on: nextcloud_db: condition: service_healthy nextcloud_redis: condition: service_healthy environment: POSTGRES_HOST: nextcloud_db POSTGRES_DB: nextcloud POSTGRES_USER: nextcloud POSTGRES_PASSWORD: ${DB_PASSWORD} REDIS_HOST: nextcloud_redis healthcheck: test: curl -f http://localhost/status.php || exit 1 interval: 30s timeout: 10s retries: 3 networks: - default - traefik volumes: - ./config/opcache.ini:/usr/local/etc/php/conf.d/opcache.ini:ro - ./data:/var/www/html nextcloud_db: image: postgres:17 container_name: nextcloud_db restart: always environment: POSTGRES_DB: nextcloud POSTGRES_USER: nextcloud POSTGRES_PASSWORD: ${DB_PASSWORD} healthcheck: test: pg_isready interval: 30s timeout: 10s retries: 3 networks: - default volumes: - ./db:/var/lib/postgresql/data nextcloud_redis: image: redis:8 container_name: nextcloud_redis restart: always healthcheck: test: redis-cli ping interval: 30s timeout: 10s retries: 3 networks: - default volumes: - ./cache:/data networks: traefik: external: true