Last active
October 22, 2019 07:21
-
-
Save paulomcnally/07b2786e1b5878b96201e15fbdd87e36 to your computer and use it in GitHub Desktop.
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 exec ubuntu_postgres_1 createdb my_database -U postgres |
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
version: '3' | |
volumes: | |
postgres-data: | |
driver: local | |
services: | |
postgres: | |
image: postgres:10.10 | |
ports: | |
- 5432:5432 | |
restart: always | |
environment: | |
POSTGRES_PASSWORD: | |
volumes: | |
- /home/ubuntu/ftp/postgres/dumps:/db/dumps | |
- postgres-data:/var/lib/postgresql/data |
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 exec ubuntu_postgres_1 dropdb -U postgres my_database |
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 exec ubuntu_postgres_1 pg_restore --verbose --clean --no-acl --no-owner -U postgres -d my_database /db/dumps/latest.dump |
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 exec ubuntu_postgres_1 pg_restore --verbose --clean --no-acl --no-owner -U postgres -d my_database --schema=public /db/dumps/latest.dump |
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 exec ubuntu_postgres_1 createdb -T my_database new_my_database -U postgres |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment