Skip to content

Instantly share code, notes, and snippets.

@duderamos
Created September 17, 2018 00:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save duderamos/c352e61ebc605f7076b948e297fd789b to your computer and use it in GitHub Desktop.
Save duderamos/c352e61ebc605f7076b948e297fd789b to your computer and use it in GitHub Desktop.
DB_CONTAINER="$(docker-compose ps -q pgsql-10.4)"
DB_NAME=postgres
DB_USER=postgres
LOCAL_DUMP_PATH="eeeff09c-9a4f-498a-8098-f38341fc984d.dump"
docker-compose up -d ${DB_CONTAINER}
docker exec -i "${DB_CONTAINER}" pg_restore -C --clean --no-acl --no-owner -U "${DB_USER}" -d "${DB_NAME}" < "${LOCAL_DUMP_PATH}"
docker-compose stop ${DB_CONTAINER}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment