Skip to content

Instantly share code, notes, and snippets.

@IvanCl4udio
Last active October 2, 2023 14:33
Show Gist options
  • Save IvanCl4udio/c0af840ede8a8eae24b57171ab6b63aa to your computer and use it in GitHub Desktop.
Save IvanCl4udio/c0af840ede8a8eae24b57171ab6b63aa to your computer and use it in GitHub Desktop.
How start a container docker with Postgresql

Postgresql Container

Start

docker run -d \
--name postgres \
-p 5432:5432 \
-e POSTGRES_PASSWORD=secret \
-e PGDATA=/var/lib/postgresql/data/pgdata \
-v ~/volumes/pgdata:/var/lib/postgresql/data \
postgres

Stop

docker stop postgres && docker rm postgres

URL Docker Hub

https://hub.docker.com/_/postgres

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment