Skip to content

db_postgres_postgrest

yml
version: '3.3'
services:
  db:
    image: postgres:13-alpine
    restart: always
    environment:
      - TZ=Asia/Shanghai
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD={YOUR_PGRST_PASSWORD}
    ports:
      - '127.0.0.1:5432:5432'
    volumes: 
      - db:/var/lib/postgresql/data
      - ./db/init.sql:/docker-entrypoint-initdb.d/create_tables.sql
    shm_size: 512mb
    network_mode: bridge
  rest:
    image: postgrest/postgrest
    restart: always
    environment:
      PGRST_DB_URI: postgres://postgres:{YOUR_PGRST_PASSWORD}@127.0.0.1:5432/postgres
      PGRST_DB_SCHEMA: {PGRST_DB_SCHEMA}
      PGRST_DB_ANON_ROLE: app_anon
      PGRST_JWT_SECRET: {PGRST_JWT_SECRET}
      PGRST_OPENAPI_SERVER_PROXY_URI: http://127.0.0.1:3000
    depends_on:
      - db
    network_mode: host
volumes:
  db:
    driver: local

Released under the MIT License.