version: "3.8" services: next-cloud: image: nextcloud:29 ports: - 8080:80 environment: POSTGRES_HOST: postgres-db POSTGRES_DB: nextcloud POSTGRES_USER: nextcloud POSTGRES_PASSWORD: strongpassword volumes: - nextcloud_data:/var/www/html networks: - nextcloud_net deploy: replicas: 1 restart_policy: condition: on-failure volumes: nextcloud_data: networks: nextcloud_net: driver: overlay postgres_network: external: true