We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 400e9f2 commit ea49e85Copy full SHA for ea49e85
00-postgres-init.sh
@@ -19,6 +19,14 @@ docker run --rm --name post_setup \
19
-v $HOME/docker/volumes/postgres:/var/lib/postgresql/data \
20
postgres:13.3
21
22
+# wait for the postgres service to be ready
23
+if ! command -v timeout &> /dev/null
24
+then
25
+ echo "`timeout` could not be found. On Mac, run `brew install coreutils`"
26
+ exit
27
+fi
28
+timeout 20s bash -c "until docker exec post_setup pg_isready; do sleep 1; done"
29
+
30
# create a new role, and two databases
31
echo "CREATE ROLE rahul WITH PASSWORD 'pass' CREATEDB LOGIN;
32
CREATE DATABASE work; CREATE DATABASE anomaly;" | \
0 commit comments