Files
eryao/infra/docker/supabase/docker-compose.yml
T

228 lines
8.0 KiB
YAML

name: eryao-supabase
services:
db:
container_name: eryao-supabase-db
image: supabase/postgres:15.8.1.085
restart: unless-stopped
volumes:
- ./volumes/db/webhooks.sql:/docker-entrypoint-initdb.d/init-scripts/98-webhooks.sql:ro
- ./volumes/db/roles.sql:/docker-entrypoint-initdb.d/init-scripts/99-roles.sql:ro
- ./volumes/db/jwt.sql:/docker-entrypoint-initdb.d/init-scripts/99-jwt.sql:ro
- ./volumes/db/_supabase.sql:/docker-entrypoint-initdb.d/migrations/97-_supabase.sql:ro
- ./volumes/db/local-dev-grants.sql:/docker-entrypoint-initdb.d/init-scripts/100-local-dev-grants.sql:ro
- ./volumes/db/data:/var/lib/postgresql/data
- db-config:/etc/postgresql-custom
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres", "-h", "localhost"]
interval: 5s
timeout: 5s
retries: 10
environment:
POSTGRES_HOST: /var/run/postgresql
PGPORT: 5432
POSTGRES_PORT: 5432
PGPASSWORD: ${ERYAO_DATABASE__PASSWORD}
POSTGRES_PASSWORD: ${ERYAO_DATABASE__PASSWORD}
PGDATABASE: ${ERYAO_DATABASE__NAME:-eryao}
POSTGRES_DB: ${ERYAO_DATABASE__NAME:-eryao}
JWT_SECRET: ${ERYAO_SUPABASE__JWT_SECRET}
JWT_EXP: 3600
command: ["postgres", "-c", "config_file=/etc/postgresql/postgresql.conf", "-c", "log_min_messages=fatal"]
ports:
- 127.0.0.1:${ERYAO_DATABASE__PORT:-5432}:5432
auth:
container_name: eryao-supabase-auth
image: supabase/gotrue:v2.186.0
restart: unless-stopped
depends_on:
db:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:9999/health"]
interval: 5s
timeout: 5s
retries: 3
environment:
GOTRUE_API_HOST: 0.0.0.0
GOTRUE_API_PORT: 9999
API_EXTERNAL_URL: ${ERYAO_SUPABASE__PUBLIC_URL:-http://localhost:8001}
GOTRUE_DB_DRIVER: postgres
GOTRUE_DB_DATABASE_URL: postgres://supabase_auth_admin:${ERYAO_DATABASE__PASSWORD}@db:5432/${ERYAO_DATABASE__NAME:-eryao}
GOTRUE_SITE_URL: http://localhost:3000
GOTRUE_URI_ALLOW_LIST: ""
GOTRUE_DISABLE_SIGNUP: "false"
GOTRUE_JWT_ADMIN_ROLES: service_role
GOTRUE_JWT_AUD: authenticated
GOTRUE_JWT_DEFAULT_GROUP_NAME: authenticated
GOTRUE_JWT_EXP: 3600
GOTRUE_JWT_SECRET: ${ERYAO_SUPABASE__JWT_SECRET}
GOTRUE_EXTERNAL_EMAIL_ENABLED: "true"
GOTRUE_EXTERNAL_PHONE_ENABLED: "false"
GOTRUE_MAILER_AUTOCONFIRM: "false"
GOTRUE_SMTP_ADMIN_EMAIL: dev@example.com
GOTRUE_SMTP_HOST: localhost
GOTRUE_SMTP_PORT: 2500
GOTRUE_SMTP_USER: disabled
GOTRUE_SMTP_PASS: disabled
GOTRUE_SMTP_SENDER_NAME: disabled
GOTRUE_MAILER_URLPATHS_INVITE: /auth/v1/verify
GOTRUE_MAILER_URLPATHS_CONFIRMATION: /auth/v1/verify
GOTRUE_MAILER_URLPATHS_RECOVERY: /auth/v1/verify
GOTRUE_MAILER_URLPATHS_EMAIL_CHANGE: /auth/v1/verify
rest:
container_name: eryao-supabase-rest
image: postgrest/postgrest:v14.8
restart: unless-stopped
depends_on:
db:
condition: service_healthy
environment:
PGRST_DB_URI: postgres://authenticator:${ERYAO_DATABASE__PASSWORD}@db:5432/${ERYAO_DATABASE__NAME:-eryao}
PGRST_DB_SCHEMAS: public,storage,graphql_public
PGRST_DB_MAX_ROWS: 1000
PGRST_DB_EXTRA_SEARCH_PATH: public
PGRST_DB_ANON_ROLE: anon
PGRST_JWT_SECRET: ${ERYAO_SUPABASE__JWT_SECRET}
PGRST_DB_USE_LEGACY_GUCS: "false"
PGRST_APP_SETTINGS_JWT_SECRET: ${ERYAO_SUPABASE__JWT_SECRET}
PGRST_APP_SETTINGS_JWT_EXP: 3600
storage:
container_name: eryao-supabase-storage
image: supabase/storage-api:v1.48.26
restart: unless-stopped
depends_on:
db:
condition: service_healthy
rest:
condition: service_started
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://storage:5000/status"]
interval: 5s
timeout: 5s
retries: 3
start_period: 10s
environment:
ANON_KEY: ${ERYAO_SUPABASE__ANON_KEY}
SERVICE_KEY: ${ERYAO_SUPABASE__SERVICE_ROLE_KEY}
POSTGREST_URL: http://rest:3000
AUTH_JWT_SECRET: ${ERYAO_SUPABASE__JWT_SECRET}
DATABASE_URL: postgres://supabase_storage_admin:${ERYAO_DATABASE__PASSWORD}@db:5432/${ERYAO_DATABASE__NAME:-eryao}
STORAGE_PUBLIC_URL: ${ERYAO_SUPABASE__PUBLIC_URL:-http://localhost:8001}
REQUEST_ALLOW_X_FORWARDED_PATH: "true"
FILE_SIZE_LIMIT: 52428800
STORAGE_BACKEND: file
GLOBAL_S3_BUCKET: ${ERYAO_STORAGE__ATTACHMENT__BUCKET:-agent-chat-attachments}
FILE_STORAGE_BACKEND_PATH: /var/lib/storage
TENANT_ID: local
REGION: local
ENABLE_IMAGE_TRANSFORMATION: "false"
volumes:
- storage-data:/var/lib/storage
meta:
container_name: eryao-supabase-meta
image: supabase/postgres-meta:v0.96.3
restart: unless-stopped
depends_on:
db:
condition: service_healthy
environment:
PG_META_PORT: 8080
PG_META_DB_HOST: db
PG_META_DB_PORT: 5432
PG_META_DB_NAME: ${ERYAO_DATABASE__NAME:-eryao}
PG_META_DB_USER: postgres
PG_META_DB_PASSWORD: ${ERYAO_DATABASE__PASSWORD}
PG_META_DB_SSL_MODE: disable
healthcheck:
test: ["CMD", "/bin/sh", "-c", "exit 0"]
interval: 10s
timeout: 5s
retries: 1
studio:
container_name: eryao-supabase-studio
image: supabase/studio:2026.04.08-sha-205cbe7
restart: unless-stopped
depends_on:
meta:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "node -e \"require('http').get('http://0.0.0.0:3000/', (r) => process.exit(r.statusCode < 500 ? 0 : 1)).on('error', () => process.exit(1))\""]
interval: 10s
timeout: 10s
retries: 3
start_period: 15s
environment:
HOSTNAME: "0.0.0.0"
STUDIO_PG_META_URL: http://meta:8080
POSTGRES_PASSWORD: ${ERYAO_DATABASE__PASSWORD}
POSTGRES_HOST: db
POSTGRES_PORT: 5432
POSTGRES_DB: ${ERYAO_DATABASE__NAME:-eryao}
POSTGRES_USER: supabase_admin
DEFAULT_ORGANIZATION_NAME: Default Organization
DEFAULT_PROJECT_NAME: Default Project
SUPABASE_URL: http://kong:8000
SUPABASE_PUBLIC_URL: ${ERYAO_SUPABASE__PUBLIC_URL:-http://localhost:8001}
SUPABASE_ANON_KEY: ${ERYAO_SUPABASE__ANON_KEY}
SUPABASE_SERVICE_KEY: ${ERYAO_SUPABASE__SERVICE_ROLE_KEY}
AUTH_JWT_SECRET: ${ERYAO_SUPABASE__JWT_SECRET}
EDGE_FUNCTIONS_MANAGEMENT_FOLDER: /var/lib/functions
LOGFLARE_API_KEY: local-logflare-public-token
LOGFLARE_URL: http://localhost:4000
NEXT_PUBLIC_ENABLE_LOGS: "false"
volumes:
- studio-functions:/var/lib/functions
kong:
container_name: eryao-supabase-kong
image: kong/kong:3.9.1
restart: unless-stopped
depends_on:
auth:
condition: service_healthy
rest:
condition: service_started
storage:
condition: service_healthy
studio:
condition: service_started
meta:
condition: service_healthy
healthcheck:
test: ["CMD", "kong", "health"]
interval: 5s
timeout: 5s
retries: 5
ports:
- 127.0.0.1:8001:8000/tcp
- 127.0.0.1:8443:8443/tcp
volumes:
- ./volumes/api/kong.yml:/home/kong/temp.yml:ro
- ./volumes/api/kong-entrypoint.sh:/home/kong/kong-entrypoint.sh:ro
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,post-function,basic-auth,ip-restriction
SUPABASE_ANON_KEY: ${ERYAO_SUPABASE__ANON_KEY}
SUPABASE_SERVICE_KEY: ${ERYAO_SUPABASE__SERVICE_ROLE_KEY}
SUPABASE_PUBLISHABLE_KEY: ""
SUPABASE_SECRET_KEY: ""
ANON_KEY_ASYMMETRIC: ""
SERVICE_ROLE_KEY_ASYMMETRIC: ""
DASHBOARD_USERNAME: localadmin
DASHBOARD_PASSWORD: LocalAdmin-Change-This-Now
entrypoint: /home/kong/kong-entrypoint.sh
volumes:
db-config:
storage-data:
studio-functions: