Fakultas Ilmu Komputer UI

entrypoint.sh 426 Bytes
Newer Older
1
2
3
4
5
# File: docker_phx/entrypoint.sh
#!/bin/bash
# docker entrypoint script.

# assign a default for the database_user
6
DB_USER=${DATABASE_USER:-postgres}
7

8
9
10
11
12
13
# wait until Postgres is ready
while ! pg_isready -q -h $DATABASE_HOST -p 5432 -U $DB_USER
do
  echo "$(date) - waiting for database to start"
  sleep 2
done
14
15
16
17
18

bin="/app/bin/diskuy"
eval "$bin eval \"Diskuy.Release.migrate\""
# start the elixir application
exec "$bin" "start"