services-garbaye/podman-matrix/10_install.sh

32 lines
1.2 KiB
Bash
Raw Normal View History

2021-06-14 10:42:59 +00:00
#!/usr/bin/env bash
ABSDIR="$( dirname "$(readlink -f -- "$0")" )"
source ${ABSDIR}/../functions.sh
source ${ABSDIR}/vars.sh
ensure_pwd_is_scriptdir
ensure_not_root
if [[ ! -d ~/.local/share/containers/storage/volumes/${confvolume} ]]; then
echo "Error : conf volume ${confvolume} does not exists. Consider running 05_freshinstall.sh if this is the first install."
exit 1
fi
if [[ ! -d ~/.local/share/containers/storage/volumes/${dbvolume} ]]; then
echo "Error : conf volume ${dbvolume} does not exists. Consider running 05_freshinstall.sh if this is the first install."
exit 1
fi
podman pod create --publish 8086:8008 --name ${pod_name} && \
podman run -d --name ${db_container_name} --pod ${pod_name} \
--mount type=volume,src=${dbvolume},dst=/var/lib/postgresql/data/${container_name} \
-e POSTGRES_PASSWORD=mysecretpass \
-e POSTGRES_USER=${container_name} \
-e POSTGRES_DB=${container_name} \
-e POSTGRES_INITDB_ARGS="--encoding=UTF8 --locale=C" \
-e PGDATA=/var/lib/postgresql/data/${container_name} ${postgres_image} && \
podman run -d --name synapse --pod ${pod_name} \
--mount type=volume,src=${confvolume},dst=/data ${synapse_image} && \
podman pod stop && \
echo Pod built and stopped