96 lines
2.9 KiB
YAML
Executable File
96 lines
2.9 KiB
YAML
Executable File
# GreySec Security — Self-Hosted Supabase
|
|
# Lean stack: Postgres (pgvector) + PostgREST + Kong
|
|
# Auth: optional, skip for now (use service role key for agents)
|
|
# Start: /tmp/docker-compose -f ~/.hermes/scripts/supabase/docker/docker-compose.yml up -d
|
|
|
|
services:
|
|
##############################################################################
|
|
# POSTGRES WITH PGVECTOR
|
|
##############################################################################
|
|
postgres:
|
|
image: supabase/postgres:15.6.1.117
|
|
container_name: greysec_postgres
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
|
POSTGRES_DB: postgres
|
|
POSTGRES_USER: postgres
|
|
ports:
|
|
- "5432:5432"
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
networks:
|
|
- supabase
|
|
|
|
##############################################################################
|
|
# POSTGREST - REST API FOR POSTGRES
|
|
##############################################################################
|
|
postgrest:
|
|
image: postgrest/postgrest:v12.0.2
|
|
container_name: greysec_postgrest
|
|
restart: unless-stopped
|
|
user: "0:0"
|
|
environment:
|
|
PGRST_DB_URI: postgres://postgres:${POSTGRES_PASSWORD}@postgres:5432/postgres
|
|
PGRST_DB_SCHEMA: public
|
|
PGRST_DB_ANON_ROLE: postgres
|
|
PGRST_JWT_SECRET: ${JWT_SECRET}
|
|
PGRST_DB_USE_LEGACY_GUCS: "false"
|
|
PGRST_APP_SETTINGS_JWT_SECRET: ${JWT_SECRET}
|
|
ports:
|
|
- "3000:3000"
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "wget -qO- http://localhost:3000/ || exit 1"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
networks:
|
|
- supabase
|
|
|
|
##############################################################################
|
|
# KONG - API GATEWAY
|
|
##############################################################################
|
|
kong:
|
|
image: kong:3.4
|
|
container_name: greysec_kong
|
|
restart: unless-stopped
|
|
user: "0:0"
|
|
environment:
|
|
KONG_DATABASE: "off"
|
|
KONG_DECLARATIVE_CONFIG: /var/lib/kong/kong.yml
|
|
KONG_DNS_ORDER: LAST,A,CNAME
|
|
KONG_PLUGINS: request-transformer,cors,jwt
|
|
KONG_LOG_LEVEL: info
|
|
ports:
|
|
- "9999:8000"
|
|
- "9998:8001"
|
|
volumes:
|
|
- ./kong.yml:/var/lib/kong/kong.yml:ro
|
|
depends_on:
|
|
postgrest:
|
|
condition: service_healthy
|
|
networks:
|
|
- supabase
|
|
|
|
##############################################################################
|
|
# NETWORKS
|
|
##############################################################################
|
|
networks:
|
|
supabase:
|
|
driver: bridge
|
|
|
|
##############################################################################
|
|
# VOLUMES
|
|
##############################################################################
|
|
volumes:
|
|
postgres_data:
|
|
driver: local
|