Skip to content

theasp/docker-postgrest-sqitch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-postgrest-sqitch

Run PostgREST after deploying a schema using Sqitch, based on the offical PostgREST image.

Add your Sqitch configuration to /sqitch by building a new image, or by mounting a volume. The schema will be deployed to PGRST_DB_URI.

Environment Variables

  • PGRST_DB_URI (required) - Database URI
  • SQITCH_DEPLOY (default deploy) - The sqitch command to use to deploy. You can use this to pass arguments as well, for example deploy --verify.
  • SQITCH_VERIFY (default verify) - The sqitch command to use to verify, or skip on empty string.
  • SQITCH_REQUIRED (default auto) - If set to true, postgrest will not be started if there is a problem with sqitch. If set to auto then sqitch will be skipped if there is no sqitch.plan available.

Example Dockerfile

FROM theasp/postgrest-sqitch
ADD ./ /sqitch

Example docker-compose.yml

---
version: '3'

services:
  postgrest:
    image: mydb-postgrest
    build: .
    ports:
      - "3000:3000"
    restart: always
    environment:
      PGRST_DB_URI: postgres://mydb:mydb@postgres:5432/mydb
      PGRST_DB_SCHEMA: public
      PGRST_DB_ANON_ROLE: anonymous
      PGRST_SERVER_PROXY_URI: http://localhost:3000
      SQITCH_DEPLOY: deploy --verify

  postgres:
    image: postgres
    restart: always
    environment:
      POSTGRES_DB: mydb
      POSTGRES_USER: mydb
      POSTGRES_PASSWORD: mydb

Releases

No releases published

Packages

No packages published