Files
spliit/scripts/start-local-db.sh
Ulrich Zorn 19c009f6b8
All checks were successful
CI / checks (push) Successful in 1m1s
fix(db): Correct local db script volume mount for modern postgres images (minimal fix) (#460)
The scripts/start-local-db.sh script was failing for modern PostgreSQL Docker images (version 18+) due to an incorrect volume mount point.

This commit provides a minimal fix by changing the volume mount from /var/lib/postgresql/data to /var/lib/postgresql, which is the correct path for modern postgres images.
2025-11-13 16:34:22 +01:00

11 lines
397 B
Bash
Executable File

result=$(docker ps | grep spliit-db)
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 spliit-db -d -p 5432:5432 -e POSTGRES_PASSWORD=1234 -v "/$(pwd)/postgres-data:/var/lib/postgresql" postgres
sleep 5 # Wait for postgres to start
fi