db: container_name:supabase-db image:supabase/postgres:15.1.0.147 healthcheck: test:pg_isready-Upostgres-hlocalhost interval:5s timeout:5s retries:10 depends_on: vector: condition:service_healthy command: -postgres --c -config_file=/etc/postgresql/postgresql.conf --c -log_min_messages=fatal# prevents Realtime polling queries from appearing in logs restart:unless-stopped ports: # Pass down internal port because it's set dynamically by other services -${POSTGRES_PORT}:${POSTGRES_PORT} environment: POSTGRES_HOST:/var/run/postgresql PGPORT:${POSTGRES_PORT} POSTGRES_PORT:${POSTGRES_PORT} PGPASSWORD:${POSTGRES_PASSWORD} POSTGRES_PASSWORD:${POSTGRES_PASSWORD} PGDATABASE:${POSTGRES_DB} POSTGRES_DB:${POSTGRES_DB} JWT_SECRET:${JWT_SECRET} JWT_EXP:${JWT_EXPIRY} volumes: -./volumes/db/realtime.sql:/docker-entrypoint-initdb.d/migrations/99-realtime.sql:Z # Must be superuser to create event trigger -./volumes/db/webhooks.sql:/docker-entrypoint-initdb.d/init-scripts/98-webhooks.sql:Z # Must be superuser to alter reserved role -./volumes/db/roles.sql:/docker-entrypoint-initdb.d/init-scripts/99-roles.sql:Z # Initialize the database settings with JWT_SECRET and JWT_EXP -./volumes/db/jwt.sql:/docker-entrypoint-initdb.d/init-scripts/99-jwt.sql:Z # PGDATA directory is persisted between restarts -./volumes/db/data:/var/lib/postgresql/data:Z # Changes required for Analytics support -./volumes/db/logs.sql:/docker-entrypoint-initdb.d/migrations/99-logs.sql:Z
# 镜像配置 auth: container_name:supabase-auth image:supabase/gotrue:v2.125.1 depends_on: db: # Disable this if you are using an external Postgres database condition:service_healthy analytics: condition:service_healthy environment: GOTRUE_API_HOST:0.0.0.0 GOTRUE_API_PORT:9999 API_EXTERNAL_URL:${API_EXTERNAL_URL}
rest: container_name:supabase-rest image:postgrest/postgrest:v12.0.1 depends_on: db: # Disable this if you are using an external Postgres database condition:service_healthy analytics: condition:service_healthy restart:unless-stopped environment: PGRST_DB_URI:postgres://authenticator:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB} PGRST_DB_SCHEMAS:${PGRST_DB_SCHEMAS} PGRST_DB_ANON_ROLE:anon PGRST_JWT_SECRET:${JWT_SECRET} PGRST_DB_USE_LEGACY_GUCS:"false" PGRST_APP_SETTINGS_JWT_SECRET:${JWT_SECRET} PGRST_APP_SETTINGS_JWT_EXP:${JWT_EXPIRY} command:"postgrest"
LOGFLARE_API_KEY:${LOGFLARE_API_KEY} LOGFLARE_URL:http://analytics:4000 NEXT_PUBLIC_ENABLE_LOGS:true # Comment to use Big Query backend for analytics NEXT_ANALYTICS_BACKEND_PROVIDER:postgres # Uncomment to use Big Query backend for analytics # NEXT_ANALYTICS_BACKEND_PROVIDER: bigquery
analytics: container_name:supabase-analytics image:supabase/logflare:1.4.0 # Uncomment to use Big Query backend for analytics # volumes: # - type: bind # source: ${PWD}/gcloud.json # target: /opt/app/rel/logflare/bin/gcloud.json # read_only: true environment: LOGFLARE_NODE_HOST:127.0.0.1 DB_USERNAME:supabase_admin DB_DATABASE:${POSTGRES_DB} DB_HOSTNAME:${POSTGRES_HOST} DB_PORT:${POSTGRES_PORT} DB_PASSWORD:${POSTGRES_PASSWORD} DB_SCHEMA:_analytics LOGFLARE_API_KEY:${LOGFLARE_API_KEY} LOGFLARE_SINGLE_TENANT:true LOGFLARE_SUPABASE_MODE:true
# Comment variables to use Big Query backend for analytics POSTGRES_BACKEND_URL:postgresql://supabase_admin:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB} POSTGRES_BACKEND_SCHEMA:_analytics LOGFLARE_FEATURE_FLAG_OVERRIDE:multibackend=true
# Uncomment to use Big Query backend for analytics # GOOGLE_PROJECT_ID: ${GOOGLE_PROJECT_ID} # GOOGLE_PROJECT_NUMBER: ${GOOGLE_PROJECT_NUMBER} ports: -4000:4000
STUDIO_PORT=3000 # replace if you intend to use Studio outside of localhost SUPABASE_PUBLIC_URL=http://localhost:8000
# Enable webp support IMGPROXY_ENABLE_WEBP_DETECTION=true
############ # Functions - Configuration for Functions ############ # NOTE: VERIFY_JWT applies to all functions. Per-function VERIFY_JWT is not supported yet. FUNCTIONS_VERIFY_JWT=false
############ # Logs - Configuration for Logflare # Please refer to https://supabase.com/docs/reference/self-hosting-analytics/introduction ############