diff --git a/apps/formbricks-com/pages/docs/self-hosting/deployment/index.mdx b/apps/formbricks-com/pages/docs/self-hosting/deployment/index.mdx index dac3889e8a..3c0de0c261 100644 --- a/apps/formbricks-com/pages/docs/self-hosting/deployment/index.mdx +++ b/apps/formbricks-com/pages/docs/self-hosting/deployment/index.mdx @@ -152,12 +152,12 @@ Certainly, here is the reformatted version for Formbricks environment variables. These variables must also be provided at runtime. -| Variable | Description | Required | Default | -| ---------------------- | --------------------------------------------------------------------------------------- | -------- | ----------------------------------------------------------------------- | -| NEXT_PUBLIC_WEBAPP_URL | Base URL of the site. | required | `http://localhost:3000` | -| DATABASE_URL | Database URL with credentials. | required | `postgresql://postgres:postgres@postgres:5432/formbricks?schema=public` | -| NEXTAUTH_SECRET | Secret for NextAuth, used for session signing and encryption. | required | (Generated by the user) | -| NEXTAUTH_URL | Location of the auth server. By default, this is the Formbricks docker instance itself. | required | `http://localhost:3000` | +| Variable | Description | Required | Default | +| --------------- | --------------------------------------------------------------------------------------- | -------- | ----------------------------------------------------------------------- | +| WEBAPP_URL | Base URL of the site. | required | `http://localhost:3000` | +| DATABASE_URL | Database URL with credentials. | required | `postgresql://postgres:postgres@postgres:5432/formbricks?schema=public` | +| NEXTAUTH_SECRET | Secret for NextAuth, used for session signing and encryption. | required | (Generated by the user) | +| NEXTAUTH_URL | Location of the auth server. By default, this is the Formbricks docker instance itself. | required | `http://localhost:3000` | ### Build-time Variables diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 0417e894ea..567eaa4dcf 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -1,6 +1,9 @@ version: "3.3" x-environment: &environment environment: + # The url of your Formbricks instance used in the admin panel + WEBAPP_URL: + # PostgreSQL DB for Formbricks to connect to DATABASE_URL: "postgresql://postgres:postgres@postgres:5432/formbricks?schema=public" diff --git a/docker/production.sh b/docker/production.sh index c379a18802..4d4289199c 100644 --- a/docker/production.sh +++ b/docker/production.sh @@ -108,6 +108,9 @@ cat <docker-compose.yml version: "3.3" x-environment: &environment environment: + # The url of your Formbricks instance used in the admin panel + WEBAPP_URL: "https://$domain_name" + # PostgreSQL DB for Formbricks to connect to DATABASE_URL: "postgresql://postgres:postgres@postgres:5432/formbricks?schema=public" diff --git a/packages/lib/constants.ts b/packages/lib/constants.ts index 39a211caab..9cb888f9d9 100644 --- a/packages/lib/constants.ts +++ b/packages/lib/constants.ts @@ -8,6 +8,7 @@ const RAILWAY_STATIC_URL = process.env.RAILWAY_STATIC_URL ? `https://${process.e const HEROKU_URL = process.env.HEROKU_APP_NAME ? `https://${process.env.HEROKU_APP_NAME}.herokuapp.com` : ""; const RENDER_URL = process.env.RENDER_EXTERNAL_URL ? `https://${process.env.RENDER_EXTERNAL_URL}` : ""; export const WEBAPP_URL = + process.env.WEBAPP_URL || process.env.NEXT_PUBLIC_WEBAPP_URL || VERCEL_URL || RAILWAY_STATIC_URL || diff --git a/turbo.json b/turbo.json index 770babd189..765445a672 100644 --- a/turbo.json +++ b/turbo.json @@ -78,7 +78,8 @@ "STRIPE_SECRET_KEY", "STRIPE_WEBHOOK_SECRET", "TELEMETRY_DISABLED", - "VERCEL_URL" + "VERCEL_URL", + "WEBAPP_URL" ] }, "post-install": {