blockstream-satellite-api/docker_entrypoint.sh
2019-01-16 10:22:44 -08:00

16 lines
389 B
Bash
Executable File

#!/bin/bash
set -eo pipefail
# create or migrate the db (if needed)
if [ ! -f /data/ionosphere/ionosphere_production.sqlite3 ]; then
bundle exec rake db:create
bundle exec rake db:schema:load
fi
bundle exec rake db:migrate
bundle exec rackup --host 0.0.0.0
# shutdown the entire process when any of the background jobs exits (even if successfully)
wait -n
kill -TERM $$