Skip to content

Instantly share code, notes, and snippets.

@filewalkwithme
Last active July 1, 2017 02:39
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 filewalkwithme/f14d88e249471e1a2c11f723eed7895e to your computer and use it in GitHub Desktop.
Save filewalkwithme/f14d88e249471e1a2c11f723eed7895e to your computer and use it in GitHub Desktop.
run a local postgres container
# How to run the container
docker run --rm --name container-name -p 5432:5432 -e POSTGRES_USER=username -e POSTGRES_DB=dbname -e POSTGRES_PASSWORD=password -v /local/path/to/data/:/var/lib/postgresql/data postgres
# How to connect via psql
psql -h 0.0.0.0 -U username -W
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment