Created
November 27, 2018 05:48
-
-
Save iamucil/6014bfa49af7c5cae4faf41691e0bebf to your computer and use it in GitHub Desktop.
Using docker volume to store postgresql-data into one volume, mount postgresql data on postgresql docker container into docker volume on local machine
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
```bash | |
docker volume create postgres-data | |
``` | |
-- override docker-compose > docker-compose.override.yml | |
version: '3' | |
services: | |
postgres: | |
environment: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: dbPassw0rd | |
volumes: | |
- "postgre-data:/var/lib/postgresql/data" | |
volumes: | |
postgre-data: | |
external: true | |
docker-compose -f docker-compose.yaml -f docker-compose.override.yml up --build |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment