diff --git a/dockerfiles/swh-storage/entrypoint.sh b/dockerfiles/swh-storage/entrypoint.sh index df60f70..3db7946 100755 --- a/dockerfiles/swh-storage/entrypoint.sh +++ b/dockerfiles/swh-storage/entrypoint.sh @@ -1,40 +1,39 @@ #!/bin/bash set -e if [[ -d /src ]] ; then for srcrepo in /src/swh-* ; do - pushd $srcrepo - pip install -e . - popd + pushd $srcrepo + pip install -e . + popd done fi echo "${PGHOST}:5432:${POSTGRES_DB}:${PGUSER}:${POSTGRES_PASSWORD}" > ~/.pgpass cat > ~/.pg_service.conf < /dev/null 2> /dev/null; do sleep 0.1; done - echo Waiting for postgresql to start - until psql service=swh -c "select 1" > /dev/null 2> /dev/null; do sleep 0.1; done + echo Setup the database + PGPASSWORD=${POSTGRES_PASSWORD} swh-db-init storage \ + --db-name ${POSTGRES_DB} - echo Setup the database - PGPASSWORD=${POSTGRES_PASSWORD} swh-db-init storage \ - --db-name ${POSTGRES_DB} - - echo Starting the swh-storage API server - exec python -m swh.storage.api.server /storage.yml - ;; + echo Starting the swh-storage API server + exec python -m swh.storage.api.server /storage.yml + ;; esac