OpenDataAPI/docker-compose.yml

60 lines
1.7 KiB
YAML
Raw Permalink Normal View History

2024-01-24 16:29:09 +01:00
---
version: "3.8"
2024-02-08 14:28:28 +01:00
networks:
opendata:
name: ${OPENDATA_NETWORK_NAME:-opendata}
2024-01-24 16:29:09 +01:00
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
2024-02-08 14:28:28 +01:00
networks:
- opendata
2024-02-08 12:28:51 +01:00
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
2024-02-08 14:28:28 +01:00
networks:
- opendata
2024-01-24 16:29:09 +01:00
swagger:
container_name: ${SWAGGER_CONTAINER_NAME:-swagger}
2024-02-08 12:28:51 +01:00
image: ${SWAGGER_IMAGE:-swaggerapi/swagger-ui:v5.11.0}
2024-01-24 16:29:09 +01:00
restart: always
environment:
2024-02-08 12:28:51 +01:00
API_URL: ${POSTGREST_URL:-http://localhost:3000/}
2024-02-08 14:28:28 +01:00
depends_on:
- postgrest
networks:
- opendata