generated from BloomTech-Labs/coder-heroes-be-a
-
Notifications
You must be signed in to change notification settings - Fork 3
/
autopgstart.sh
19 lines (18 loc) · 675 Bytes
/
autopgstart.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/zsh
# This script is used to pull the latest postgresql image, and start the
# server automatically, removing human error for program startup.
# just run: "./autopgstart.sh" without the "" from the
# root of the project directory.
# The docker command to start the postgresql server.
docker compose up --remove-orphans
# wait for the container to be running, and accepting connections before
# starting the fP.main()
if [[ $(docker inspect -f '{{.State.Running}}' postgres) == "true" ]]; then
echo "PostgreSQL server is running."
echo "Starting fP.main()..."
fP.main()
else
echo "PostgreSQL server is not running."
echo "Exiting..."
exit 1
fi