--- version: "3.8" volumes: postgres: name: ${POSTGRES_VOLUME_NAME:-postgres} services: postgres: container_name: ${POSTGRES_CONTAINER_NAME:-postgres} image: ${POSTGRES_IMAGE:-postgres:16.1-alpine} restart: always 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 postgrest: container_name: ${POSTGREST_CONTAINER_NAME:-postgrest} image: ${POSTGREST_IMAGE:-postgrest/postgrest:v12.0.0} restart: always # https://postgrest.org/en/latest/configuration.html#environment-variables environment: PGRST_DB_URI: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:?err} PGRST_DB_SCHEMA: ${DB_SCHEMA} PGRST_DB_ANON_ROLE: ${DB_ANON_ROLE} PGRST_OPENAPI_SERVER_PROXY_URI: ${POSTGREST_URL:-http://localhost:3000} # https://postgrest.org/en/stable/references/configuration.html#db-max-rows PGRST_DB_MAX_ROWS: ${PGRST_DB_MAX_ROWS:-100} depends_on: - postgres swagger: container_name: ${SWAGGER_CONTAINER_NAME:-swagger} image: ${SWAGGER_IMAGE:-swaggerapi/swagger-ui:v5.11.0} restart: always environment: API_URL: ${POSTGREST_URL:-http://localhost:3000/}