80 lines
2.3 KiB
YAML
80 lines
2.3 KiB
YAML
---
|
|
|
|
version: "3.8"
|
|
|
|
volumes:
|
|
postgres:
|
|
name: ${POSTGRES_VOLUME_NAME:-postgres}
|
|
|
|
services:
|
|
|
|
postgrest:
|
|
container_name: ${POSTGREST_CONTAINER_NAME:-postgrest}
|
|
image: ${POSTGREST_IMAGE:-postgrest/postgrest:v12.0.0}
|
|
restart: always
|
|
ports:
|
|
- "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}@postgres:5432/${POSTGRES_DB:?err}
|
|
# 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
|
|
depends_on:
|
|
- postgres
|
|
networks:
|
|
- back-end
|
|
|
|
postgrest-demo:
|
|
container_name: postgrest-demo
|
|
image: nginx:mainline-alpine
|
|
ports:
|
|
- "80:80"
|
|
volumes:
|
|
# anything in html directory is hosted via nginx
|
|
- "./html:/usr/share/nginx/html"
|
|
restart: always
|
|
networks:
|
|
- back-end
|
|
|
|
postgres:
|
|
container_name: ${POSTGRES_CONTAINER_NAME:-postgres}
|
|
image: ${POSTGRES_IMAGE:-postgres:16.1-alpine}
|
|
restart: always
|
|
ports:
|
|
- "5432:5432"
|
|
environment:
|
|
POSTGRES_USER: ${POSTGRES_USER:?err}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?err}
|
|
POSTGRES_DB: ${POSTGRES_DB:?err}
|
|
DB_ANON_ROLE: ${DB_ANON_ROLE:?err}
|
|
DB_SCHEMA: ${DB_SCHEMA:?err}
|
|
volumes:
|
|
- postgres:/var/lib/postgresql/data
|
|
- "./initdb:/docker-entrypoint-initdb.d"
|
|
- /etc/timezone:/etc/timezone:ro
|
|
- /etc/localtime:/etc/localtime:ro
|
|
networks:
|
|
- back-end
|
|
|
|
swagger:
|
|
container_name: ${SWAGGER_CONTAINER_NAME:-swagger}
|
|
image: ${SWAGGER_IMAGE:-swaggerapi/swagger-ui:v5.10.3}
|
|
restart: always
|
|
ports:
|
|
- "8080:8080"
|
|
environment:
|
|
API_URL: http://localhost:3000/
|
|
networks:
|
|
- front-end
|
|
- back-end
|
|
|
|
networks:
|
|
front-end:
|
|
back-end: |