aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/start-local-db.sh
diff options
context:
space:
mode:
authorMax <Max-TheCat@users.noreply.github.com>2024-01-11 15:25:08 -0500
committerGitHub <noreply@github.com>2024-01-11 15:25:08 -0500
commit76427c9f130adb90f90cccc84b92dd49f5147ed5 (patch)
tree5e1ac61ffaff7040e3b85a98cee9f4fd11dac54a /scripts/start-local-db.sh
parentddce4d0bdbf657de1bf11ce2722ed0435868e41d (diff)
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>
Diffstat (limited to 'scripts/start-local-db.sh')
-rwxr-xr-xscripts/start-local-db.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/start-local-db.sh b/scripts/start-local-db.sh
new file mode 100755
index 0000000..c97173d
--- /dev/null
+++ b/scripts/start-local-db.sh
@@ -0,0 +1,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