Skip to content

Instantly share code, notes, and snippets.

@doyle
Created April 2, 2024 17:46
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 doyle/9b998f9c93b9be9d82e492ad6f14f16c to your computer and use it in GitHub Desktop.
Save doyle/9b998f9c93b9be9d82e492ad6f14f16c to your computer and use it in GitHub Desktop.
Dump and load a postgres database in a docker container
docker compose exec database pg_dump -U <user> -W <datbase> > database.sql
docker compose exec -T database psql -U <user> <database> < database.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment