Files
calctext/docker-compose.yml
C. Cassel 1e640aa0c8 fix: use base URL for Supabase client, nginx proxies /rest/v1/ and /auth/v1/
The Supabase JS client auto-derives API paths from the base URL:
- REST: ${url}/rest/v1/
- Auth: ${url}/auth/v1/

Nginx now proxies these standard paths to the correct backend services.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 16:45:36 -04:00

85 lines
2.4 KiB
YAML

services:
# Supabase PostgreSQL (includes auth schema + extensions)
db:
image: supabase/postgres:15.8.1.060
restart: unless-stopped
environment:
POSTGRES_PASSWORD: ${DB_PASSWORD:-postgres}
POSTGRES_DB: postgres
volumes:
- calctext-db:/var/lib/postgresql/data
- ./supabase/migrations:/docker-entrypoint-initdb.d/migrations
healthcheck:
test: pg_isready -U postgres -d postgres
interval: 5s
timeout: 5s
retries: 10
# Supabase Auth (GoTrue)
auth:
image: supabase/gotrue:v2.158.1
restart: unless-stopped
depends_on:
db:
condition: service_healthy
environment:
GOTRUE_API_HOST: 0.0.0.0
GOTRUE_API_PORT: 9999
API_EXTERNAL_URL: ${SITE_URL:-http://localhost:5173}/auth
GOTRUE_DB_DRIVER: postgres
GOTRUE_DB_DATABASE_URL: postgres://postgres:${DB_PASSWORD:-postgres}@db:5432/postgres?sslmode=disable
GOTRUE_SITE_URL: ${SITE_URL:-http://localhost:5173}
GOTRUE_URI_ALLOW_LIST: ${SITE_URL:-http://localhost:5173}/**
GOTRUE_DISABLE_SIGNUP: 'false'
GOTRUE_JWT_SECRET: ${JWT_SECRET}
GOTRUE_JWT_EXP: 3600
GOTRUE_JWT_DEFAULT_GROUP_NAME: authenticated
GOTRUE_EXTERNAL_EMAIL_ENABLED: 'true'
GOTRUE_MAILER_AUTOCONFIRM: 'true'
GOTRUE_SMTP_ADMIN_EMAIL: admin@calctext.local
# PostgREST (REST API for database)
rest:
image: postgrest/postgrest:v12.2.8
restart: unless-stopped
depends_on:
db:
condition: service_healthy
environment:
PGRST_DB_URI: postgres://postgres:${DB_PASSWORD:-postgres}@db:5432/postgres
PGRST_DB_SCHEMAS: public
PGRST_DB_ANON_ROLE: anon
PGRST_JWT_SECRET: ${JWT_SECRET}
PGRST_DB_USE_LEGACY_GUCS: 'false'
# Hocuspocus collaboration server
collab:
build: ./collab-server
restart: unless-stopped
depends_on:
db:
condition: service_healthy
environment:
PORT: 4000
DATABASE_URL: postgres://postgres:${DB_PASSWORD:-postgres}@db:5432/postgres
JWT_SECRET: ${JWT_SECRET}
# Web frontend (nginx + static files)
web:
build:
context: .
args:
VITE_SUPABASE_URL: ${SITE_URL:-http://localhost:8080}
VITE_SUPABASE_ANON_KEY: ${ANON_KEY}
VITE_COLLAB_WS_URL: ${COLLAB_WS_URL:-ws://localhost:8080/ws}
restart: unless-stopped
ports:
- "${PORT:-8080}:8080"
depends_on:
- auth
- rest
- collab
volumes:
calctext-db: