Skip to content

Latest commit

 

History

History
executable file
·
29 lines (20 loc) · 949 Bytes

File metadata and controls

executable file
·
29 lines (20 loc) · 949 Bytes

Postgres container scripts

Scripts to run and interact with a local containerised Postgres.

Intended for local dev and not for production environments!

Uses a local data volume to store the pgdata.

See .env for details of the set up.

Prerequisites

General workflow

Note: make sure you run scripts from the root of your Rails app.

  • Create the container for the first time
    • bin/postgres/create
  • Access an interactive psql console into the running Postgres
    • bin/postgres/console
  • Stop the container when you don't need it
    • bin/postgres/stop
  • Start the container when you do need it again
    • bin/postgres/start
  • Destroy the container if you want to recreate it or just don't need it anymore (note: the local data volume will NOT be deleted)
    • bin/postgres/destroy