services: nextcloud: image: nextcloud:latest restart: always depends_on: - db ports: - 80:80 - 443:443 environment: NEXTCLOUD_ADMIN_USER: NEXTCLOUD_ADMIN_PASSWORD: NEXTCLOUD_TRUSTED_DOMAINS: POSTGRES_HOST: db POSTGRES_DB: nextcloud POSTGRES_USER: nextcloud POSTGRES_PASSWORD: secret volumes: - ./data:/var/www/html healthcheck: test: ["CMD", "curl", "-f", "http://localhost:80/"] interval: 15s timeout: 5s retries: 3 start_period: 90s networks: - internal nextcloud-cron: image: nextcloud:latest restart: always entrypoint: /cron.sh volumes: - ./data:/var/www/html networks: - internal db: image: postgres:15 restart: always environment: - POSTGRES_DB=nextcloud - POSTGRES_USER=nextcloud - POSTGRES_PASSWORD=secret volumes: - ./db:/var/lib/postgresql/data networks: - internal networks: internal: driver: bridge