This commit is contained in:
Your Name
2025-04-25 17:58:31 +12:00
parent 72e757ebd6
commit 09035aa2aa
5 changed files with 33 additions and 34 deletions

View File

@ -27,7 +27,7 @@ load_env() {
source "$script_dir/_basic.env"
set +a
else
echo "Warning: basic.env file not found at $script_dir/_basic.env. Broken template?"
echo "Warning: _basic.env file not found at $script_dir/_basic.env. Broken template?"
return 1
fi
@ -35,23 +35,18 @@ load_env() {
if [ -z "$1" ]; then
echo "Usage: $0 [path_to_env_file]"
return 1
else
# If path is relative, make it absolute using script directory as base
if [[ "$1" != /* ]]; then
env_file="$script_dir/$1"
else
env_file="$1"
fi
fi
if [ -f "$env_file" ]; then
set -a
source "$env_file"
set +a
else
echo "Warning: .env file not found at $env_file"
env_file="$1/service.env"
if [ ! -f "$env_file" ]; then
echo "Warning: service.env file not found in $1"
return 1
fi
set -a
source "$env_file"
set +a
}
grey_start() {

View File

@ -0,0 +1,5 @@
{
"auths": {
}
}

View File

@ -1,6 +1,8 @@
#!/bin/bash
source "$(dirname "$0")/_common.sh"
load_env "$1" || die "Failed to load environment variables"
SERVICE_CONFIG_DIR="$1"
load_env "$SERVICE_CONFIG_DIR" || die "Failed to load environment variables"
# Required environment variables
check_required_env_vars "CONTAINER_NAME" "INTERVAL"
@ -9,6 +11,7 @@ DOCKER_RUN_CMD="docker run -d \
--restart unless-stopped \
--name ${CONTAINER_NAME} \
-v /var/run/docker.sock:/var/run/docker.sock \
-v ${SERVICE_CONFIG_DIR}/config.json:/config.json
${IMAGE_REGISTRY}/${IMAGE_REPO}:${IMAGE_TAG} \
--interval ${INTERVAL}"