22 lines
732 B
Bash
22 lines
732 B
Bash
|
#!/usr/bin/env bash
|
||
|
|
||
|
ABSDIR="$( dirname "$(realpath -s -- "$0")" )"
|
||
|
source ${ABSDIR}/../functions.sh
|
||
|
source ${ABSDIR}/vars.sh
|
||
|
|
||
|
ensure_pwd_is_scriptdir
|
||
|
ensure_not_root
|
||
|
|
||
|
ensure_container_not_exists ${container_name}
|
||
|
ensure_variables_are_defined "$envvars"
|
||
|
|
||
|
if ! podman image exists ${ntfy_image}:${ntfy_version}; then
|
||
|
podman image pull ${ntfy_image}:${ntfy_version} || exit 1
|
||
|
fi
|
||
|
|
||
|
podman run --name ${container_name} -p ${listen_if}:${listen_port}:8080 -d ${ntfy_image}:${ntfy_version} serve --listen-http :8080 --base-url ${GARBAYE_NTFY_BASE_URL} &&
|
||
|
podman cp config/server.yml ${container_name}:/etc/ntfy/server.yml &&
|
||
|
sleep 10 &&
|
||
|
podman stop ${container_name} &&
|
||
|
echo Container ${container_name} successfully built and stopped.
|