philomena/docker/app/run-development

24 lines
523 B
Text
Raw Normal View History

2019-12-03 19:36:50 +01:00
#!/bin/bash
# Always install assets
(cd /srv/philomena/assets && npm install)
# Always install mix dependencies
(cd /srv/philomena && mix deps.get)
# Sleep to allow Elasticsearch to finish initializing
# if it's not done doing whatever it does yet
echo -n "Waiting for Elasticsearch"
2019-12-03 23:56:26 +01:00
until wget -qO - elasticsearch:9200; do
2019-12-03 19:36:50 +01:00
echo -n "."
sleep 2
done
echo
# Try to create the database if it doesn't exist yet
2019-12-03 23:56:26 +01:00
createdb -h postgres -U postgres philomena_dev && mix ecto.setup_dev
2019-12-03 19:36:50 +01:00
# Run the application
mix phx.server