Skip to content

Instantly share code, notes, and snippets.

@mindscratch
Created February 2, 2019 17:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mindscratch/df47f092aa91c4965d57934b219c8b36 to your computer and use it in GitHub Desktop.
Save mindscratch/df47f092aa91c4965d57934b219c8b36 to your computer and use it in GitHub Desktop.
Run postgres in docker for dev
#!/bin/bash
DB_USER=user
DB_PASSWORD=password
DB=demo
DATA_DIR="$(pwd)/postgres-data"
mkdir -p $DATA_DIR
docker run -d -p 5432:5432 \
-e POSTGRES_USER=$DB_USER \
-e POSTGRES_PASSWORD=$DB_PASSWORD \
-e POSTGRES_DB=$DB \
-v $DATA_DIR:/var/lib/postgresql/data postgres:9.6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment