#!/bin/bash cd /var/www/owncloud # Check if .env file exists if [ ! -f .env ]; then echo "Error: .env file not found in /var/www/owncloud" exit 1 fi # Create network if it doesn't exist if ! docker network ls | grep -q 'ocis-net'; then docker network create --driver=overlay ocis-net fi # Automatically export all variables from .env file set -a source .env set +a # Deploy the stack envsubst < docker-stack.yml | docker stack deploy selfhosted-owncloud --compose-file=docker-stack.yml --with-registry-auth --resolve-image always