version: "3.8" services: db: image: postgres:16 environment: POSTGRES_DB: nextcloud POSTGRES_USER: nextcloud POSTGRES_PASSWORD: strongpassword volumes: - db_data:/var/lib/postgresql/data networks: - nextcloud_net deploy: replicas: 1 restart_policy: condition: on-failure app: image: nextcloud:29 ports: - 8080:80 environment: POSTGRES_HOST: db POSTGRES_DB: nextcloud POSTGRES_USER: nextcloud POSTGRES_PASSWORD: strongpassword volumes: - nextcloud_data:/var/www/html depends_on: - db networks: - nextcloud_net deploy: replicas: 1 restart_policy: condition: on-failure volumes: db_data: nextcloud_data: networks: nextcloud_net: driver: overlay