version: '3.2' services: db: image: postgres restart: always volumes: - db:/var/lib/postgresql/data environment: - POSTGRES_PASSWORD_FILE=/run/secrets/postgres_password secrets: - postgres_password app: image: nextcloud restart: always ports: - 8080:80 volumes: - nextcloud:/var/www/html environment: - POSTGRES_HOST=db - POSTGRES_PASSWORD_FILE=/run/secrets/postgres_password - NEXTCLOUD_ADMIN_PASSWORD_FILE=/run/secrets/nextcloud_admin_password depends_on: - db secrets: - nextcloud_admin_password - postgres_password volumes: db: nextcloud: secrets: nextcloud_admin_password: external: true postgres_password: external: true