# capgo-setup: one-shot job of the self-host stack. Applies supabase/bootstrap.sql and # Capgo's migrations to the database with psql (scripts/selfhost-setup.ts), then exits. # Running it again applies only new migrations. # # docker run --rm \ # -e DATABASE_URL=postgresql://postgres:@:5432/postgres \ # -e SUPABASE_ADMIN_URL=postgresql://supabase_admin:@:5432/postgres \ # ghcr.io/cap-go/capgo-setup # # The database must be the supabase/postgres image (17.6.1.143): the migrations create # Supabase-only extensions. In a compose stack, run this after GoTrue has applied its own # migrations, so bootstrap.sql's auth part finds GoTrue's objects instead of creating them. # # Build from the repository root: docker build -f selfhost/capgo-setup/Dockerfile . # Built and published by .github/workflows/selfhost_images.yml. # Same Bun version as scripts/setup-bun.sh. FROM oven/bun:1.3.11-alpine LABEL org.opencontainers.image.source="https://github.com/Cap-go/capgo.app" \ org.opencontainers.image.description="Capgo self-host setup: applies database migrations" \ org.opencontainers.image.licenses="AGPL-3.0-only" RUN apk add --no-cache postgresql17-client WORKDIR /app COPY scripts/selfhost-setup.ts scripts/local-db.ts scripts/supabase-worktree-config.ts scripts/ COPY supabase/bootstrap.sql supabase/ COPY supabase/migrations/ supabase/migrations/ # The base image's non-root user. USER bun ENTRYPOINT ["bun", "scripts/selfhost-setup.ts"]