version: '3' services: ################ # postgrest-db # ################ postgrest-db: container_name: postgrest-db image: postgres:alpine ports: - "127.0.0.1:5432:5432" environment: - POSTGRES_USER=${POSTGRES_USER} - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} - POSTGRES_DB=${POSTGRES_DB} - DB_ANON_ROLE=${DB_ANON_ROLE} - DB_SCHEMA=${DB_SCHEMA} volumes: # anything in initdb directory is created in the database # see "How to extend this image" section at https://hub.docker.com/r/_/postgres/ - ".config/initdb:/docker-entrypoint-initdb.d" networks: - postgrest-backend restart: unless-stopped ################## # postgrest-demo # ################## postgrest-demo: container_name: postgrest-demo image: nginx:mainline-alpine ports: - "127.0.0.1:8084:80" volumes: # anything in html directory is hosted via nginx - ".demo/html:/usr/share/nginx/html" restart: unless-stopped ############# # postgrest # ############# postgrest: container_name: postgrest image: postgrest/postgrest:latest ports: - "127.0.0.1:3000:3000" # Available environment variables documented here: # https://postgrest.org/en/latest/configuration.html#environment-variables environment: # The standard connection URI format, documented at # https://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-CONNSTRING - PGRST_DB_URI=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgrest-db:5432/${POSTGRES_DB} # The name of which database schema to expose to REST clients - PGRST_DB_SCHEMA=${DB_SCHEMA} # The database role to use when no client authentication is provided - PGRST_DB_ANON_ROLE=${DB_ANON_ROLE} # Overrides the base URL used within the OpenAPI self-documentation hosted at the API root path - PGRST_OPENAPI_SERVER_PROXY_URI=http://localhost:3000 networks: - postgrest-backend restart: unless-stopped networks: postgrest-backend: driver: bridge