Changeset View
Changeset View
Standalone View
Standalone View
dockerfiles/swh-storage-listener/entrypoint.sh
Show All 15 Lines | |||||
dbname=${POSTGRES_DB} | dbname=${POSTGRES_DB} | ||||
host=${PGHOST} | host=${PGHOST} | ||||
port=5432 | port=5432 | ||||
user=${PGUSER} | user=${PGUSER} | ||||
EOF | EOF | ||||
chmod 0600 ~/.pgpass | chmod 0600 ~/.pgpass | ||||
echo Installed Python packages: | |||||
pip list | |||||
case "$1" in | case "$1" in | ||||
"shell") | "shell") | ||||
exec bash -i | exec bash -i | ||||
;; | ;; | ||||
*) | *) | ||||
echo "Waiting for postgresql to start" | echo "Waiting for postgresql to start" | ||||
until psql service=swh -c "select 1" 1>&2 >/dev/null; do sleep 0.1; done | until psql service=swh -c "select 1" 1>&2 >/dev/null; do sleep 0.1; done | ||||
echo "Starting swh-storage's listener" | echo "Starting swh-storage's listener" | ||||
exec python3 -m swh.storage.listener --verbose | exec python3 -m swh.storage.listener --verbose | ||||
;; | ;; | ||||
esac | esac |