Skip to content

Instantly share code, notes, and snippets.

@naramdash
Last active June 21, 2022 06:34
Show Gist options
  • Save naramdash/9e296edf5dae391ee1835a4cee83b902 to your computer and use it in GitHub Desktop.
Save naramdash/9e296edf5dae391ee1835a4cee83b902 to your computer and use it in GitHub Desktop.
run postgres with docker volume
# do before run.sh
docker volume create postgres-volume
docker run \
--name postgres-14-container \
--env POSTGRES_PASSWORD=postgres \
--env PGDATA=/var/lib/postgresql/data/pgdata \
--restart always \
--detach \
--volume postgres-volume:/var/lib/postgresql/data \
-p 5432:5432 \
postgres:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment