This images uses pg_dev as a base and adds PostgREST for development. It's considered a drop-in replacement during development, while running the official images of PostgreSQL and PostgREST in production.
Currently, the following helper script is added on top of pg_dev
:
run_pgrst
: Runs postgrest with connection parameters extracted from libpq-stylePG*
environment variables. The authenticator role defaults toPGUSER
, but can be overriden withPGRST_DEV_AUTHENTICATOR
.with pgrst
: Wrapper around command which makes PostgREST available atlocalhost:3000
viarun_pgrst
.
Mount your source code into the container and run curl
with a temporary database and PostgREST instance:
docker run --rm -v "$PWD:/usr/src" tool with pg with sql schema.sql with pgrst curl http://localhost:3000
This will load the schema defined in schema.sql
through psql, start PostgREST and then fetch the OpenAPI output from the root endpoint.