Skip to content

Instantly share code, notes, and snippets.

@nodew
Last active April 10, 2022 15:22
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 nodew/a663e1db59211e3a06820e3cd06b5e3b to your computer and use it in GitHub Desktop.
Save nodew/a663e1db59211e3a06820e3cd06b5e3b to your computer and use it in GitHub Desktop.
Run PostgresSQL in docker container
docker volume create pgdata
docker run -d `
--name my_postgres `
-e POSTGRES_USER=postgres `
-e POSTGRES_PASSWORD=myPassword `
-e POSTGRES_DB=postgres `
-e PGDATA=/var/lib/postgresql/data/pgdata `
-v pgdata:/var/lib/postgresql/data/pgdata `
-p 5432:5432 `
postgres:latest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment