Skip to content

Instantly share code, notes, and snippets.

@nburkley
Created June 19, 2015 12:22
Show Gist options
  • Save nburkley/b23cd061c3565f4965e4 to your computer and use it in GitHub Desktop.
Save nburkley/b23cd061c3565f4965e4 to your computer and use it in GitHub Desktop.
Importing database dump into docker application

In your compose file, map volum to a local folder that contains the database dump file

db:
  image: postgres:9.4.1
  volumes:
    - tmp:/tmp/dumps

Run the application using docker-compose up

Connect to the database container docker exec -it appname_db_1 /bin/bash

Use pg_restore to import the dump file pg_restore --verbose --data-only --no-acl --no-owner -h localhost -U dbuser -d dabase_name ./rbmaradio-db-18-06.dump

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment