supabase-nano/compose.yaml
Rama main · réplica de lectura del repositorio original.
name: supabase
services:
studio:
networks:
default:
aliases: [supabase-studio]
ports:
- "3000"
image: supabase/studio:2026.06.03-sha-0bca601
restart: unless-stopped
volumes:
- ./functions:/app/edge-functions:ro,z
- ./snippets:/app/snippets:z
healthcheck:
test:
- CMD-SHELL
- node -e "fetch('http://localhost:3000/api/platform/profile').then((r) => {if (r.status !== 200) throw new Error(r.status)})"
timeout: 10s
interval: 5s
retries: 3
start_period: 20s
environment:
HOSTNAME: 0.0.0.0
# Cap the V8 heap so Studio fits a 256 MiB allocation (~196 MiB
# resident). Heavy SQL-editor result sets will feel GC pressure.
NODE_OPTIONS: --max-old-space-size=160
STUDIO_PG_META_URL: http://supabase-meta:8080
POSTGRES_PORT: ${POSTGRES_PORT:-5432}
POSTGRES_HOST: ${POSTGRES_HOST:-supabase-db}
POSTGRES_DB: ${POSTGRES_DB:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
PG_META_CRYPTO_KEY: ${PG_META_CRYPTO_KEY}
PGRST_DB_SCHEMAS: ${PGRST_DB_SCHEMAS:-public,graphql_public}
PGRST_DB_MAX_ROWS: ${PGRST_DB_MAX_ROWS:-1000}
PGRST_DB_EXTRA_SEARCH_PATH: ${PGRST_DB_EXTRA_SEARCH_PATH:-public}
DEFAULT_ORGANIZATION_NAME: ${STUDIO_DEFAULT_ORGANIZATION:-Default Organization}
DEFAULT_PROJECT_NAME: ${STUDIO_DEFAULT_PROJECT:-Default Project}
OPENAI_API_KEY: ${OPENAI_API_KEY:-}
SUPABASE_URL: http://supabase-kong:5000
SUPABASE_PUBLIC_URL: ${SUPABASE_PUBLIC_URL}
SUPABASE_ANON_KEY: ${ANON_KEY:-eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlzcyI6InN1cGFiYXNlIiwiaWF0IjoxNzAwMDAwMDAwLCJleHAiOjIwMDAwMDAwMDB9.6ldkvHM8WjwyHI_tKbJOgWu-VbulTx9jmeuEvNGSFkY}
SUPABASE_SERVICE_KEY: ${SERVICE_ROLE_KEY:-eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoic2VydmljZV9yb2xlIiwiaXNzIjoic3VwYWJhc2UiLCJpYXQiOjE3MDAwMDAwMDAsImV4cCI6MjAwMDAwMDAwMH0.mjENke8J4x_734atFXjInx76tWeHpG_5y1KaXY_3Smg}
AUTH_JWT_SECRET: ${JWT_SECRET:-super-secret-jwt-token-with-at-least-32-characters-long}
SUPABASE_PUBLISHABLE_KEY: ${SUPABASE_PUBLISHABLE_KEY:-}
SUPABASE_SECRET_KEY: ${SUPABASE_SECRET_KEY:-}
ENABLED_FEATURES_LOGS_ALL: 'false'
SNIPPETS_MANAGEMENT_FOLDER: /app/snippets
EDGE_FUNCTIONS_MANAGEMENT_FOLDER: /app/edge-functions
kong:
networks:
default:
aliases: [supabase-kong]
restart: unless-stopped
healthcheck:
test:
- CMD
- kong
- health
interval: 5s
timeout: 5s
retries: 5
depends_on:
db:
condition: service_healthy
environment:
KONG_DATABASE: 'off'
KONG_DECLARATIVE_CONFIG: /usr/local/kong/kong.yml
KONG_DNS_ORDER: LAST,A,CNAME
KONG_DNS_NOT_FOUND_TTL: 1
KONG_PLUGINS: request-transformer,cors,key-auth,acl,basic-auth,request-termination,ip-restriction,post-function
KONG_NGINX_PROXY_PROXY_BUFFER_SIZE: 160k
# 8 buffers (1.3 MiB/connection) instead of upstream's 64: at 64 a
# burst of concurrent Studio pages OOMs a 128 MiB Kong.
KONG_NGINX_PROXY_PROXY_BUFFERS: 8 160k
# worker_processes defaults to auto (one per core): ~100 MiB per
# worker on a many-core node for a gateway that proxies a handful of
# services. One worker keeps Kong inside a small memory allocation.
KONG_NGINX_WORKER_PROCESSES: "1"
KONG_PROXY_ACCESS_LOG: /dev/stdout combined
SUPABASE_ANON_KEY: ${ANON_KEY:-eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlzcyI6InN1cGFiYXNlIiwiaWF0IjoxNzAwMDAwMDAwLCJleHAiOjIwMDAwMDAwMDB9.6ldkvHM8WjwyHI_tKbJOgWu-VbulTx9jmeuEvNGSFkY}
SUPABASE_SERVICE_KEY: ${SERVICE_ROLE_KEY:-eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoic2VydmljZV9yb2xlIiwiaXNzIjoic3VwYWJhc2UiLCJpYXQiOjE3MDAwMDAwMDAsImV4cCI6MjAwMDAwMDAwMH0.mjENke8J4x_734atFXjInx76tWeHpG_5y1KaXY_3Smg}
SUPABASE_PUBLISHABLE_KEY: ${SUPABASE_PUBLISHABLE_KEY:-}
SUPABASE_SECRET_KEY: ${SUPABASE_SECRET_KEY:-}
ANON_KEY_ASYMMETRIC: ${ANON_KEY_ASYMMETRIC:-}
SERVICE_ROLE_KEY_ASYMMETRIC: ${SERVICE_ROLE_KEY_ASYMMETRIC:-}
DASHBOARD_USERNAME: ${DASHBOARD_USERNAME}
DASHBOARD_PASSWORD: ${DASHBOARD_PASSWORD}
KONG_PROXY_LISTEN: 0.0.0.0:5000
build: ./kong
ports:
- 5000:5000
auth:
networks:
default:
aliases: [supabase-auth]
ports:
- "9999"
image: supabase/gotrue:v2.189.0
restart: unless-stopped
healthcheck:
test:
- CMD
- wget
- --no-verbose
- --tries=1
- --spider
- http://localhost:9999/health
timeout: 5s
interval: 5s
retries: 3
depends_on:
db:
condition: service_healthy
environment:
GOTRUE_API_HOST: 0.0.0.0
GOTRUE_API_PORT: 9999
API_EXTERNAL_URL: ${API_EXTERNAL_URL}
GOTRUE_DB_DRIVER: postgres
GOTRUE_DB_DATABASE_URL: postgres://supabase_auth_admin:${POSTGRES_PASSWORD}@${POSTGRES_HOST:-supabase-db}:${POSTGRES_PORT:-5432}/${POSTGRES_DB:-postgres}
GOTRUE_SITE_URL: ${SITE_URL}
GOTRUE_URI_ALLOW_LIST: ${ADDITIONAL_REDIRECT_URLS:-}
GOTRUE_DISABLE_SIGNUP: ${DISABLE_SIGNUP:-false}
GOTRUE_JWT_ADMIN_ROLES: service_role
GOTRUE_JWT_AUD: authenticated
GOTRUE_JWT_DEFAULT_GROUP_NAME: authenticated
GOTRUE_JWT_EXP: ${JWT_EXPIRY:-3600}
GOTRUE_JWT_SECRET: ${JWT_SECRET:-super-secret-jwt-token-with-at-least-32-characters-long}
GOTRUE_JWT_ISSUER: ${API_EXTERNAL_URL}/auth/v1
GOTRUE_EXTERNAL_EMAIL_ENABLED: ${ENABLE_EMAIL_SIGNUP:-true}
GOTRUE_EXTERNAL_ANONYMOUS_USERS_ENABLED: ${ENABLE_ANONYMOUS_USERS:-false}
GOTRUE_MAILER_AUTOCONFIRM: ${ENABLE_EMAIL_AUTOCONFIRM:-true}
GOTRUE_SMTP_ADMIN_EMAIL: ${SMTP_ADMIN_EMAIL:-admin@example.com}
GOTRUE_SMTP_HOST: ${SMTP_HOST:-}
GOTRUE_SMTP_PORT: ${SMTP_PORT:-587}
GOTRUE_SMTP_USER: ${SMTP_USER:-}
GOTRUE_SMTP_PASS: ${SMTP_PASS:-}
GOTRUE_SMTP_SENDER_NAME: ${SMTP_SENDER_NAME:-Supabase}
GOTRUE_MAILER_URLPATHS_INVITE: ${MAILER_URLPATHS_INVITE:-/auth/v1/verify}
GOTRUE_MAILER_URLPATHS_CONFIRMATION: ${MAILER_URLPATHS_CONFIRMATION:-/auth/v1/verify}
GOTRUE_MAILER_URLPATHS_RECOVERY: ${MAILER_URLPATHS_RECOVERY:-/auth/v1/verify}
GOTRUE_MAILER_URLPATHS_EMAIL_CHANGE: ${MAILER_URLPATHS_EMAIL_CHANGE:-/auth/v1/verify}
GOTRUE_EXTERNAL_PHONE_ENABLED: ${ENABLE_PHONE_SIGNUP:-false}
GOTRUE_SMS_AUTOCONFIRM: ${ENABLE_PHONE_AUTOCONFIRM:-false}
rest:
networks:
default:
aliases: [supabase-rest]
ports:
- "3000"
image: postgrest/postgrest:v14.12
restart: unless-stopped
depends_on:
db:
condition: service_healthy
environment:
PGRST_DB_URI: postgres://authenticator:${POSTGRES_PASSWORD}@${POSTGRES_HOST:-supabase-db}:${POSTGRES_PORT:-5432}/${POSTGRES_DB:-postgres}
PGRST_DB_SCHEMAS: ${PGRST_DB_SCHEMAS:-public,graphql_public}
PGRST_DB_MAX_ROWS: ${PGRST_DB_MAX_ROWS:-1000}
PGRST_DB_EXTRA_SEARCH_PATH: ${PGRST_DB_EXTRA_SEARCH_PATH:-public}
PGRST_DB_ANON_ROLE: anon
# Pool of 2 halves PostgREST's resident memory (~290 MiB at the
# default 10). Caps REST concurrency - that's the nano trade-off.
PGRST_DB_POOL: ${PGRST_DB_POOL:-2}
PGRST_JWT_SECRET: ${JWT_SECRET:-super-secret-jwt-token-with-at-least-32-characters-long}
PGRST_DB_USE_LEGACY_GUCS: 'false'
PGRST_APP_SETTINGS_JWT_SECRET: ${JWT_SECRET:-super-secret-jwt-token-with-at-least-32-characters-long}
PGRST_APP_SETTINGS_JWT_EXP: ${JWT_EXPIRY:-3600}
command:
- postgrest
meta:
networks:
default:
aliases: [supabase-meta]
ports:
- "8080"
image: supabase/postgres-meta:v0.96.6
restart: unless-stopped
depends_on:
db:
condition: service_healthy
environment:
# 64 MiB starves it (OOM loop on start); 96 holds at ~80 MiB resident.
NODE_OPTIONS: --max-old-space-size=96
PG_META_PORT: 8080
PG_META_DB_HOST: ${POSTGRES_HOST:-supabase-db}
PG_META_DB_PORT: ${POSTGRES_PORT:-5432}
PG_META_DB_NAME: ${POSTGRES_DB:-postgres}
PG_META_DB_USER: supabase_admin
PG_META_DB_PASSWORD: ${POSTGRES_PASSWORD}
CRYPTO_KEY: ${PG_META_CRYPTO_KEY}
db:
networks:
default:
aliases: [supabase-db]
ports:
- "5432"
restart: unless-stopped
volumes:
- dbdata:/var/lib/postgresql/data
healthcheck:
test:
- CMD
- pg_isready
- -U
- postgres
- -h
- localhost
interval: 5s
timeout: 5s
retries: 10
environment:
POSTGRES_HOST: /var/run/postgresql
PGDATA: /var/lib/postgresql/data/pgdata
PGPORT: ${POSTGRES_PORT:-5432}
POSTGRES_PORT: ${POSTGRES_PORT:-5432}
PGPASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
PGDATABASE: ${POSTGRES_DB:-postgres}
POSTGRES_DB: ${POSTGRES_DB:-postgres}
JWT_SECRET: ${JWT_SECRET:-super-secret-jwt-token-with-at-least-32-characters-long}
JWT_EXP: ${JWT_EXPIRY:-3600}
# Mirrors the CMD baked into db/Dockerfile (compose command: overrides
# do not reach Miget per-app deploys) so local runs match the platform.
command:
- postgres
- -c
- config_file=/etc/postgresql/postgresql.conf
- -c
- data_directory=/var/lib/postgresql/data/pgdata
- -c
- log_min_messages=fatal
- -c
- shared_buffers=64MB
- -c
- max_connections=40
- -c
- maintenance_work_mem=16MB
- -c
- autovacuum_max_workers=1
- -c
- max_wal_size=256MB
build: ./db
volumes:
dbdata: null