Configuration

Configure public origins, secrets, storage, authentication, email, billing, and AI providers.

Compify reads configuration from environment variables. Start from deploy/self-host.env.example; never commit the populated file. These settings belong to an operator-controlled source/release-candidate deployment. They do not turn the Compose baseline into managed hosting or a production certification.

Required settings for an exposed operator deployment

VariablePurpose
FRONTEND_URLBrowser origin allowed by API CORS and used in redirects
BACKEND_URLPublic API origin and OpenAPI server URL
NEXT_PUBLIC_API_URLAPI origin compiled into the web application
NEXT_PUBLIC_SITE_URLCanonical public web origin
NEXT_PUBLIC_CDN_URLOrigin that serves editor assets and public media
NEXT_PUBLIC_BUNDLER_URLSandpack bundler that executes interactive previews
SOURCE_REVISIONExact 40-character deployed commit for API, web, and OCI source offers
SOURCE_URLOptional immutable HTTPS override containing modified Corresponding Source
SOURCE_REPOSITORYHTTPS repository used by source links and OCI provenance labels
JWT_SECRETUser session signing secret; use a long random value
INTERNAL_API_TOKENPrivate web-to-API operations
AUTH_COOKIE_SAME_SITEBrowser cookie policy; use none only for HTTPS cross-site web/API origins
POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DBPostgreSQL bootstrap/break-glass credentials
DB_MIGRATOR_PASSWORDPassword used only by the one-shot migration role
DB_RUNTIME_PASSWORDPassword used by the non-owner, long-running API role
MINIO_*S3-compatible root/app credentials and ports

Build-time browser variables

NEXT_PUBLIC_* values are compiled into the web image. Rebuild the web service after changing them.

Optional integrations

Google OAuth, Turnstile, Stripe, ZeptoMail, and every AI provider are optional. When an integration is absent, its dependent endpoint returns an explicit unavailable response rather than preventing the API from starting.

Provider variables include OPENAI_API_KEY, ANTHROPIC_API_KEY, OPENROUTER_API_KEY, GOOGLE_AI_API_KEY, and GROQ_API_KEY. Only configure providers whose data-handling terms are acceptable for your deployment.

Database lifecycle

Schema synchronization is disabled. The long-running API image does not contain or run migrations. Compose uses separate one-shot bootstrap, migration, grant, and role-verification jobs; the API starts only after those jobs and storage initialization succeed. Back up PostgreSQL before upgrading, run the release jobs on every upgrade, and test restoration regularly. See Self-hosting for the operator procedure.

Validation

The API rejects missing core settings, malformed ports and URLs, invalid boolean flags, short JWT secrets, partially configured integration groups, and a production configuration without an exact source revision during startup. An immutable HTTPS source location may override the download URL but does not replace that revision. Use /ready for orchestration readiness and /health only for process liveness.