Skip to content

Instantly share code, notes, and snippets.

@brunodrugowick
Created September 11, 2019 02:35
Show Gist options
  • Save brunodrugowick/f669e89df54f244bcfa1c3bc2a513b7f to your computer and use it in GitHub Desktop.
Save brunodrugowick/f669e89df54f244bcfa1c3bc2a513b7f to your computer and use it in GitHub Desktop.
Script for postgres docker for development
#!/bin/bash
start() {
sudo docker run --rm --name postgres -e POSTGRES_PASSWORD=postgres -d -p 5432:5432 -v /home/drugo/docker/volumes/postgres:/var/lib/postgresql/data postgres
return 0
}
stop() {
sudo docker stop postgres
return 0
}
case $1 in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment