aboutsummaryrefslogtreecommitdiffstats
path: root/start-local-db.sh
blob: c97173d4c37e61a32a4278302e1c9101ad9f578f (plain)
1
2
3
4
5
6
7
8
9
10
11
result=$(docker ps | grep postgres)
if [ $? -eq 0 ];
then
    echo "postgres is already running, doing nothing"
else
    echo "postgres is not running, starting it"
    docker rm postgres --force
    mkdir -p postgres-data
    docker run --name postgres -d -p 5432:5432 -e POSTGRES_PASSWORD=1234 -v ./postgres-data:/var/lib/postgresql/data postgres
    sleep 5 # Wait for postgres to start
fi