Working.
This commit is contained in:
@ -6,18 +6,23 @@
|
||||
# It is called with the path to the server specific env file as an argument.
|
||||
|
||||
source "$(dirname "$0")/_common.sh"
|
||||
check_required_env_vars "CONTAINER_NAME" "HOST_PORT" "VOLUME_NAME" "WRITE_TOKENS" "CONFIG_PATH"
|
||||
check_required_env_vars "CONTAINER_NAME" "VOLUME_NAME" "CONFIG_PATH"
|
||||
|
||||
# check volume exists.
|
||||
if ! docker volume inspect "${VOLUME_NAME}" &>/dev/null; then
|
||||
die "Docker volume ${VOLUME_NAME} does not exist"
|
||||
fi
|
||||
|
||||
# determine port.
|
||||
command -v jq &> /dev/null || die "jq could not be found, please install it"
|
||||
[ -f "${CONFIG_PATH}/sos_config.json" ] || die "sos_config.json does not exist"
|
||||
PORT=$(jq -r '.port' "${CONFIG_PATH}/sos_config.json")
|
||||
|
||||
|
||||
DOCKER_RUN_CMD="docker run -d \
|
||||
--restart unless-stopped \
|
||||
--name ${CONTAINER_NAME} \
|
||||
-p ${HOST_PORT}:80 \
|
||||
-p ${PORT}:${PORT} \
|
||||
-v ${VOLUME_NAME}:/data/storage \
|
||||
-v ${CONFIG_PATH}/sos_config.json:/data/sos_config.json:ro \
|
||||
${IMAGE_REGISTRY}/${IMAGE_REPO}:${IMAGE_TAG}"
|
||||
|
Reference in New Issue
Block a user