使用 docker compose 启动 local db,并把数据存储在当前文件夹 ./local/data
Created
July 25, 2023 04:31
-
-
Save ThaddeusJiang/59afe351b4cb88e5b828d0b99418ab8e 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