selfhosted-owncloud/deploy.sh

22 lines
517 B
Bash
Raw Normal View History

2023-12-24 20:15:46 +01:00
#!/bin/bash
2023-12-24 20:57:34 +01:00
# Check if .env file exists
if [ ! -f .env ]; then
echo "Error: .env file not found in /var/www/owncloud"
exit 1
fi
2023-12-25 10:05:19 +01:00
# Create network if it doesn't exist
if ! docker network ls | grep -q 'web '; then
docker network create --driver=overlay web
fi
# Automatically export all variables from .env file
set -a
source .env
set +a
2023-12-24 20:57:34 +01:00
2023-12-25 10:05:19 +01:00
# Deploy the stack
2023-12-24 20:23:56 +01:00
envsubst < docker-stack.yml | docker stack deploy selfhosted-owncloud --compose-file=docker-stack.yml --with-registry-auth --resolve-image always
2023-12-25 10:05:19 +01:00