version: '2.4' services: app: image: 'nextcloud:21.0.1-apache' restart: 'always' healthcheck: test: 'curl -f localhost || exit 1' interval: '1m' timeout: '10s' retries: 3 start_period: '10s' depends_on: db: condition: 'service_healthy' redis: condition: 'service_healthy' env_file: - '.env' networks: - 'default' - 'nginx' volumes: - 'config:/var/www/html/config' - 'data:/var/www/html/data' - 'root:/var/www/html' cron: image: 'nextcloud:21.0.1-apache' restart: 'always' entrypoint: '/cron.sh' depends_on: app: condition: 'service_healthy' env_file: - '.env' volumes: - 'config:/var/www/html/config' - 'data:/var/www/html/data' - 'root:/var/www/html' db: image: 'postgres:14.1-alpine' restart: 'always' environment: - 'POSTGRES_DB=nextcloud' - 'POSTGRES_USER=nextcloud' - 'POSTGRES_PASSWORD=nextcloud' volumes: - 'db-data:/var/lib/postgresql/data' redis: image: 'redis:6.2.4-alpine' restart: 'always' healthcheck: test: 'redis-cli -h localhost ping' interval: '10s' timeout: '5s' retries: 3 networks: nginx: external: true volumes: config: data: db-data: root: