version: '3.8'
services:
instance-1:
build:
context: ./instance-1
networks:
- tembo
labels:
- "traefik.enable=true"
- "traefik.tcp.routers.instance-1.rule=HostSNI(`instance-1.local.tembo.io`)"
- "traefik.tcp.routers.instance-1.entrypoints=postgresql"
- "traefik.tcp.routers.instance-1.tls.passthrough=true"
- "traefik.tcp.services.instance-1.loadbalancer.server.port=5432"
instance-1-postgrest:
image: postgrest/postgrest:v12.2.8
environment:
PGRST_DB_URI: "postgresql://postgres:postgres@instance-1:5432/postgres"
PGRST_DB_SCHEMA: "public, graphql"
PGRST_DB_ANON_ROLE: "postgres"
PGRST_LOG_LEVEL: "info"
networks:
- tembo
labels:
- "traefik.enable=true"
- "traefik.http.routers.instance-1-postgrest.rule=Host(`instance-1.local.tembo.io`) && (PathPrefix(`/rest/v1`) || PathPrefix(`/graphql/v1`))"
- "traefik.http.routers.instance-1-postgrest.entrypoints=web"
- "traefik.http.services.instance-1-postgrest.loadbalancer.server.port=3000"
- "traefik.http.middlewares.postgrest-stripprefix.stripprefix.prefixes=/rest/v1, /graphql/v1"
- "traefik.http.routers.postgrest.middlewares=postgrest-stripprefix"
instance-2:
build:
context: ./instance-2
networks:
- tembo
labels:
- "traefik.enable=true"
- "traefik.tcp.routers.instance-2.rule=HostSNI(`instance-2.local.tembo.io`)"
- "traefik.tcp.routers.instance-2.entrypoints=postgresql"
- "traefik.tcp.routers.instance-2.tls.passthrough=true"
- "traefik.tcp.services.instance-2.loadbalancer.server.port=5432"
traefik:
image: traefik:v3.0.0-beta2
networks:
- tembo
command:
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.ferretdb.address=:27018/tcp"
- "--entrypoints.postgresql.address=:5432/tcp"
- "--entrypoints.traefik.address=:9000/tcp"
- "--entrypoints.web.address=:8000/tcp"
- "--api.dashboard=true"
- "--api.insecure=true"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
ports:
- "8000:8000"
- "9000:9000"
- "5432:5432"
- "27018:27018"
networks:
tembo: {}