使用 docker compose 启动 local db,并把数据存储在当前文件夹 ./local/data
-
-
Save afwu/b7697fc7ce3d3236714dc2f4c1b57766 to your computer and use it in GitHub Desktop.
docker compose local postgres db
This file contains hidden or 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
| local/ |
This file contains hidden or 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
| version: '3.1' | |
| services: | |
| db: | |
| image: postgres:13.4 | |
| restart: always | |
| ports: | |
| - 5432:5432 | |
| environment: | |
| POSTGRES_USERNAME: postgres | |
| POSTGRES_PASSWORD: *** | |
| POSTGRES_DB: local | |
| volumes: | |
| - ./local/data/postgresql:/var/lib/postgresql/data | |
| networks: | |
| - default |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment