Last active
June 21, 2022 06:34
-
-
Save naramdash/9e296edf5dae391ee1835a4cee83b902 to your computer and use it in GitHub Desktop.
run postgres with docker volume
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# do before run.sh | |
docker volume create postgres-volume |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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