Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add supavisor to supabase #2712

Open
wants to merge 6 commits into
base: next
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 50 additions & 1 deletion templates/compose/supabase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,13 @@ services:
ALTER USER supabase_auth_admin WITH PASSWORD :'pgpass';
ALTER USER supabase_functions_admin WITH PASSWORD :'pgpass';
ALTER USER supabase_storage_admin WITH PASSWORD :'pgpass';
- type: bind
source: ./volumes/db/supavisor.sql
target: /docker-entrypoint-initdb.d/init-scripts/99-supavisor.sql
content: |
\set pguser `echo "supabase_admin"`

create schema if not exists _supavisor;
- type: bind
source: ./volumes/db/jwt.sql
target: /docker-entrypoint-initdb.d/init-scripts/99-jwt.sql
Expand All @@ -597,6 +604,48 @@ services:
# Use named volume to persist pgsodium decryption key between restarts
- supabase-db-config:/etc/postgresql-custom


supabase-supavisor:
image: supabase/supavisor:1.1.67
ports:
- 4000:4000
- 5452:5452
- 6543:6543
Geczy marked this conversation as resolved.
Show resolved Hide resolved
healthcheck:
test:
[
"CMD",
"curl",
"-sSfL",
"--head",
"-o",
"/dev/null",
"-H",
"Authorization: Bearer ${SERVICE_SUPABASEANON_KEY}",
"http://127.0.0.1:4000/api/health",
]
timeout: 5s
interval: 5s
retries: 3
environment:
- PORT=4000
- PROXY_PORT_SESSION=5452
- PROXY_PORT_TRANSACTION=6543
- DATABASE_URL=ecto://postgres:${SERVICE_PASSWORD_POSTGRES}@${POSTGRES_HOST:-supabase-db}:${POSTGRES_PORT:-5432}/${POSTGRES_DB:-postgres}
- CLUSTER_POSTGRES=true
- SECRET_KEY_BASE=${SECRET_PASSWORD_REALTIME}
- VAULT_ENC_KEY=supabase-supavisor-enc-key
- API_JWT_SECRET=${SERVICE_PASSWORD_JWT}
- METRICS_JWT_SECRET=${SERVICE_PASSWORD_JWT}
- REGION=local
- ERL_AFLAGS=-proto_dist inet_tcp
depends_on:
supabase-db:
# Disable this if you are using an external Postgres database
condition: service_healthy
restart: unless-stopped
command: sh -c "/app/bin/migrate && /app/bin/server"

supabase-analytics:
image: supabase/logflare:1.4.0
healthcheck:
Expand Down Expand Up @@ -1013,7 +1062,7 @@ services:
"/dev/null",
"-H",
"Authorization: Bearer ${SERVICE_SUPABASEANON_KEY}",
"http://127.0.0.1:4000/api/tenants/realtime-dev/health"
"http://127.0.0.1:4000/api/tenants/realtime-dev/health",
]
timeout: 5s
interval: 5s
Expand Down