This commit is contained in:
Your Name
2025-04-25 12:53:03 +12:00
parent 7e499195e5
commit 2f3135053f
16 changed files with 162 additions and 119 deletions

View File

@ -1,10 +1,23 @@
#!/bin/bash
# START SCRIPT
# The start script is required for all templates.
# It is used to start the service on the server.
# It is called with the path to the server specific env file as an argument.
source "$(dirname "$0")/_common.sh"
load_env "$1" || die "Failed to load environment variables"
# Required environment variables
check_required_env_vars "CONTAINER_NAME" "HOST_PORT" "CONTAINER_PORT" "LOCAL_DATA_FOLDER"
if [ -d "${LOCAL_DATA_FOLDER}" ]; then
echo "Local data folder ${LOCAL_DATA_FOLDER} exists, skipping data folder creation"
else
echo "Local data folder ${LOCAL_DATA_FOLDER} does not exist, creating..."
mkdir -p "${LOCAL_DATA_FOLDER}"
fi
DOCKER_RUN_CMD="docker run -d \
--restart unless-stopped \
--name ${CONTAINER_NAME} \