version: "3" services: nextcloud-db: image: postgres:13.4-alpine container_name: nextcloud-db restart: always environment: - POSTGRES_USER=nextcloud - POSTGRES_PASSWORD=nextcloud - POSTGRES_DB=nextcloud volumes: - ./data/nextcloud/database:/var/lib/postgresql/data nextcloud: image: nextcloud:25.0.1-apache container_name: nextcloud restart: always environment: POSTGRES_HOST: nextcloud-db POSTGRES_DB: nextcloud POSTGRES_USER: nextcloud POSTGRES_PASSWORD: nextcloud OVERWRITEPROTOCOL: https NEXTCLOUD_ADMIN_USER: admin NEXTCLOUD_ADMIN_PASSWORD: ${NEXTCLOUD_ADMIN_PASSWORD} NEXTCLOUD_CLIENT_SECRET: ${NEXTCLOUD_CLIENT_SECRET} NEXTCLOUD_TRUSTED_DOMAINS: ${NEXTCLOUD_HOSTNAME}.${DOMAIN_NAME} env_file: - ./env.production volumes: - ./data/nextcloud/nextcloud:/var/www/html - ./nextcloud/setup.sh:/setup.sh:ro depends_on: - nextcloud-db entrypoint: ["/setup.sh"] # add the nginx configuration into the nginx volume nginx: volumes: - ./nextcloud/nginx.conf:/etc/nginx/templates/nextcloud.conf.template:ro # add the grafana client secrets to the keycloak-setup volume keycloak: volumes: - ./nextcloud/keycloak.sh:/keycloak-setup/nextcloud.sh:ro