Files
spliit/scripts/start-local-db.sh
Max 76427c9f13 Docker container version (#39)
* + Dockerfile and compose file
+ Scripts dir and startup script
+ Build image npm script

* * Moves env to file

* + Tags image with info from package.json
* Moves image creation to script
* Updates README

* Update README.md

Co-authored-by: Sebastien Castiel <sebastien@castiel.me>

---------

Co-authored-by: Maxime Jacob <mjacob-no-reply@proton.me>
Co-authored-by: Sebastien Castiel <sebastien@castiel.me>
2024-01-11 15:25:08 -05:00

12 lines
393 B
Bash
Executable File

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