Repository: formbricks/formbricks
Pull request #4909: fix: updated docker file with redis and minio containers
Author: login: victorvhs017
Labels: name: ❗️ .env changes
Created: 2025-03-10T15:16:45Z | Merged: 2025-03-17T09:48:25Z

<!-- We require pull request titles to follow the Conventional Commits specification ( https://www.conventionalcommits.org/en/v1.0.0/#summary ). Please make sure your title follow these conventions -->

## What does this PR do?

<!-- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. -->

Update the docker file with a default Redis and minio containers for development.

<!-- Please provide a screenshots or a loom video for visual changes to speed up reviews
 Loom Video: https://www.loom.com/
-->

## How should this be tested?

<!-- Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration -->

- [ ] Run `pnpm go` and check if the containers are running.
- [ ] Run the app locally and use it or call the API, then check if Redis has new records.

## Checklist

<!-- We're starting to get more and more contributions. Please help us making this efficient for all of us and go through this checklist. Please tick off what you did  -->

### Required

- [x] Filled out the "How to test" section in this PR
- [x] Read [How we Code at Formbricks](<[https://github.com/formbricks/formbricks/blob/main/CONTRIBUTING.md](https://formbricks.com/docs/contributing/how-we-code)>)
- [x] Self-reviewed my own code
- [x] Commented on my code in hard-to-understand bits
- [x] Ran `pnpm build`
- [x] Checked for warnings, there are none
- [x] Removed all `console.logs`
- [x] Merged the latest changes from main onto my branch with `git pull origin main`
- [x] My changes don't cause any responsiveness issues
- [x] First PR at Formbricks? [Please sign the CLA!](https://cla-assistant.io/formbricks/formbricks) Without it we wont be able to merge it 🙏

### Appreciated

- [ ] If a UI change was made: Added a screen recording or screenshots to this PR
- [x] Updated the Formbricks Docs if changes were necessary


<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

- **Chores**
  - Updated the environment configuration so that the Redis connection is now required.
  - Streamlined caching initialization by simplifying its activation conditions.
  - Refined container service sourcing to ensure smoother local startup.

- **New Features**
  - Introduced a new local development setup that integrates core services including a database, email preview, caching, and storage.
  - Added improved commands and task dependencies to better manage the service lifecycle during development.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->


Diff:
diff --git a/.env.example b/.env.example
index 6b5b2582f214..65baf5287b67 100644
--- a/.env.example
+++ b/.env.example
@@ -184,7 +184,7 @@ ENTERPRISE_LICENSE_KEY=
 UNSPLASH_ACCESS_KEY=
 
 # The below is used for Next Caching (uses In-Memory from Next Cache if not provided)
-# REDIS_URL=redis://localhost:6379
+REDIS_URL=redis://localhost:6379
 
 # The below is used for Rate Limiting (uses In-Memory LRU Cache if not provided) (You can use a service like Webdis for this)
 # REDIS_HTTP_URL:
diff --git a/.gitpod/init.bash b/.gitpod/init.bash
index 3aa3ad62fad2..8b02b9dddbae 100644
--- a/.gitpod/init.bash
+++ b/.gitpod/init.bash
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-images=($(yq eval '.services.*.image' packages/database/docker-compose.yml))
+images=($(yq eval '.services.*.image' docker-compose.dev.yml))
 
 pull_image() {
   docker pull "$1"
diff --git a/apps/web/cache-handler.mjs b/apps/web/cache-handler.mjs
index aa655c13e577..bf30a8df4fd2 100644
--- a/apps/web/cache-handler.mjs
+++ b/apps/web/cache-handler.mjs
@@ -11,7 +11,7 @@ const createTimeoutPromise = (ms, rejectReason) => {
 CacheHandler.onCreation(async () => {
   let client;
 
-  if (process.env.REDIS_URL && process.env.ENTERPRISE_LICENSE_KEY) {
+  if (process.env.REDIS_URL) {
     try {
       // Create a Redis client.
       client = createClient({
@@ -45,8 +45,6 @@ CacheHandler.onCreation(async () => {
           });
       }
     }
-  } else if (process.env.REDIS_URL) {
-    console.log("Redis clustering requires an Enterprise License. Falling back to LRU cache.");
   }
 
   /** @type {import("@neshca/cache-handler").Handler | null} */
diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml
new file mode 100644
index 000000000000..65a88080e5d1
--- /dev/null
+++ b/docker-compose.dev.yml
@@ -0,0 +1,44 @@
+services:
+  postgres:
+    image: pgvector/pgvector:pg17
+    volumes:
+      - postgres:/var/lib/postgresql/data
+    environment:
+      - POSTGRES_DB=postgres
+      - POSTGRES_USER=postgres
+      - POSTGRES_PASSWORD=postgres
+    ports:
+      - 5432:5432
+
+  mailhog:
+    image: arjenz/mailhog # Copy of mailhog/MailHog to support linux/arm64
+    ports:
+      - 8025:8025 # web ui
+      - 1025:1025 # smtp server
+
+  redis:
+    image: redis:7.0.11
+    ports:
+      - 6379:6379
+    volumes:
+      - redis-data:/data
+
+  minio:
+    image: minio/minio:RELEASE.2025-02-28T09-55-16Z
+    command: server /data --console-address ":9001"
+    environment:
+      - MINIO_ROOT_USER=devminio
+      - MINIO_ROOT_PASSWORD=devminio123
+    ports:
+      - "9000:9000"  # S3 API
+      - "9001:9001"  # Console
+    volumes:
+      - minio-data:/data
+
+volumes:
+  postgres:
+    driver: local
+  redis-data:
+    driver: local
+  minio-data:
+    driver: local
diff --git a/package.json b/package.json
index 2d29bd2822ff..072c87cba173 100644
--- a/package.json
+++ b/package.json
@@ -17,7 +17,9 @@
     "db:migrate:deploy": "turbo run db:migrate:deploy",
     "db:start": "turbo run db:start",
     "db:push": "turbo run db:push",
-    "go": "turbo run go --concurrency 20",
+    "db:up": "docker compose -f docker-compose.dev.yml up -d",
+    "db:down": "docker compose -f docker-compose.dev.yml down",
+    "go": "pnpm db:up && turbo run go --concurrency 20",
     "dev": "turbo run dev --parallel",
     "pre-commit": "lint-staged",
     "start": "turbo run start --parallel",
diff --git a/packages/database/docker-compose.yml b/packages/database/docker-compose.yml
deleted file mode 100644
index 6b41cd0d30f3..000000000000
--- a/packages/database/docker-compose.yml
+++ /dev/null
@@ -1,21 +0,0 @@
-services:
-  postgres:
-    image: pgvector/pgvector:pg17
-    volumes:
-      - postgres:/var/lib/postgresql/data
-    environment:
-      - POSTGRES_DB=postgres
-      - POSTGRES_USER=postgres
-      - POSTGRES_PASSWORD=postgres
-    ports:
-      - 5432:5432
-
-  mailhog:
-    image: arjenz/mailhog # Copy of mailhog/MailHog to support linux/arm64
-    ports:
-      - 8025:8025 # web ui
-      - 1025:1025 # smtp server
-
-volumes:
-  postgres:
-    driver: local
diff --git a/packages/database/package.json b/packages/database/package.json
index a49df5872160..96f6896a0177 100644
--- a/packages/database/package.json
+++ b/packages/database/package.json
@@ -13,10 +13,8 @@
     "db:create-saml-database:deploy": "env SAML_DATABASE_URL=\"${SAML_DATABASE_URL}\" tsx ./src/scripts/create-saml-database.ts",
     "db:create-saml-database:dev": "dotenv -e ../../.env -- tsx ./src/scripts/create-saml-database.ts",
     "db:push": "prisma db push --accept-data-loss",
-    "db:up": "docker compose up -d",
-    "db:setup": "pnpm db:up && pnpm db:migrate:dev && pnpm db:create-saml-database:dev",
+    "db:setup": "pnpm db:migrate:dev && pnpm db:create-saml-database:dev",
     "db:start": "pnpm db:setup",
-    "db:down": "docker compose down",
     "format": "prisma format",
     "generate": "prisma generate",
     "lint": "eslint ./src --fix",
diff --git a/turbo.json b/turbo.json
index b3dba1dfc9cf..d96174d12bf2 100644
--- a/turbo.json
+++ b/turbo.json
@@ -10,6 +10,9 @@
       "dependsOn": ["@formbricks/api#build"],
       "persistent": true
     },
+    "@formbricks/database#setup": {
+      "dependsOn": ["db:up"]
+    },
     "@formbricks/demo#go": {
       "cache": false,
       "dependsOn": ["@formbricks/js#build"],
@@ -221,6 +224,10 @@
     "db:start": {
       "cache": false
     },
+    "db:up": {
+      "cache": false,
+      "outputs": []
+    },
     "dev": {
       "cache": false,
       "persistent": true


Reviews:
user: login: coderabbitai[bot]
body: **Actionable comments posted: 0**

<details>
<summary>🧹 Nitpick comments (3)</summary><blockquote>

<details>
<summary>.gitpod/init.bash (1)</summary><blockquote>

`3-3`: **Updated Docker image source to new development compose file.**

The script now pulls images from `docker-compose.dev.yml` instead of `packages/database/docker-compose.yml`, correctly reflecting the reorganization of Docker configurations.


However, note that Shellcheck warns about array declaration. Consider using `mapfile` or `read -a` instead for better bash practices:

```diff
-images=($(yq eval '.services.*.image' docker-compose.dev.yml))
+mapfile -t images < <(yq eval '.services.*.image' docker-compose.dev.yml)
```

<details>
<summary>🧰 Tools</summary>

<details>
<summary>🪛 Shellcheck (0.10.0)</summary>

[warning] 3-3: Prefer mapfile or read -a to split command output (or quote to avoid splitting).

(SC2207)

</details>

</details>

</blockquote></details>
<details>
<summary>docker-compose.dev.yml (2)</summary><blockquote>

`1-11`: **Postgres Service Configuration: Looks Good**

The Postgres service is configured correctly with the chosen image, environment variables, port mapping, and persistent volume for data storage. For enhanced resilience in a development setup, consider adding a restart policy (e.g., `restart: unless-stopped`) as an optional improvement.

---

`19-25`: **Redis Service Configuration: Correct Setup with Room for Optional Enhancements**

The Redis service uses the appropriate image, exposes the necessary port, and sets up data persistence via a volume. Optionally, you might consider including a health check and a restart policy to improve stability during development.

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between b21827cb3294649e5178860c0899ca7e59e81509 and 3b135f5ae92d96e560b0d2cc56d19c72fce2aecf.

</details>

<details>
<summary>📒 Files selected for processing (7)</summary>

* `.env.example` (1 hunks)
* `.gitpod/init.bash` (1 hunks)
* `apps/web/cache-handler.mjs` (1 hunks)
* `docker-compose.dev.yml` (1 hunks)
* `docs/self-hosting/setup/one-click.mdx` (1 hunks)
* `packages/database/docker-compose.yml` (0 hunks)
* `packages/database/package.json` (1 hunks)

</details>

<details>
<summary>💤 Files with no reviewable changes (1)</summary>

* packages/database/docker-compose.yml

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🪛 Shellcheck (0.10.0)</summary>

<details>
<summary>.gitpod/init.bash</summary>

[warning] 3-3: Prefer mapfile or read -a to split command output (or quote to avoid splitting).

(SC2207)

</details>

</details>

</details>

<details>
<summary>⏰ Context from checks skipped due to timeout of 90000ms (6)</summary>

* GitHub Check: Run E2E Tests / Run E2E Tests
* GitHub Check: Run Linters / Linters
* GitHub Check: Build Formbricks-web / Build Formbricks-web
* GitHub Check: Analyze (javascript)
* GitHub Check: SonarQube
* GitHub Check: Tusk Tester

</details>

<details>
<summary>🔇 Additional comments (8)</summary><blockquote>

<details>
<summary>docs/self-hosting/setup/one-click.mdx (1)</summary>

`279-279`: **Update documentation to reflect new Docker file path.**

The path to the docker-compose.yml file has been updated from `formbricks/docker-compose.yml` to `formbricks/docker/docker-compose.yml`, which correctly reflects the new file structure. This change ensures users are directed to the right location for configuration adjustments.

</details>
<details>
<summary>.env.example (1)</summary>

`187-187`: **Added Redis as standard configuration.**

The REDIS_URL environment variable has been uncommented, making Redis a standard component rather than optional. This change aligns with the PR objective of including Redis containers for development.

</details>
<details>
<summary>packages/database/package.json (1)</summary>

`16-16`: **Updated database scripts to use the new Docker Compose file.**

The scripts now explicitly reference the development Docker Compose file at the repository root, ensuring consistency with other changes in this PR.



Also applies to: 19-19

</details>
<details>
<summary>apps/web/cache-handler.mjs (2)</summary>

`14-26`: **Simplified Redis client creation logic.**

The Redis client creation logic has been simplified by removing the dependency on `ENTERPRISE_LICENSE_KEY`. Now, the code attempts to create a Redis client directly based on the `REDIS_URL`, making Redis a standard component rather than an enterprise-only feature.

This change aligns with the PR's objective of adding Redis containers for development and the uncommented `REDIS_URL` in the `.env.example` file.

---

`26-46`: **Improved Redis client connection handling.**

The connection logic now only proceeds if the client has been successfully created, which prevents potential null reference errors. The error handling for failed connections remains intact.

</details>
<details>
<summary>docker-compose.dev.yml (3)</summary>

`13-18`: **Mailhog Service Configuration: Clear and Informative**

The Mailhog service is properly defined with clear port mappings and a helpful comment explaining the image choice for linux/arm64 compatibility. This configuration is straightforward and effective for development purposes.

---

`26-37`: **Minio Service Configuration: Comprehensive and Well-Structured**

The Minio service is configured correctly with the specified image, command, environment variables, port mappings (for both the S3 API and the console), and persistent volume. Verify that the chosen image tag meets your long-term development requirements, but otherwise this setup is solid.

---

`38-44`: **Volume Definitions: Properly Declared**

The volume declarations for postgres, redis-data, and minio-data are correctly set up using the local driver. This ensures data persistence across container restarts.

</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-10T15:19:20Z
user: login: mattinannt
body: @victorvhs017 thank you for the pull request 😊 Overall looks great; I only find a few small things that we need to tweak :-) 
state: CHANGES_REQUESTED
author_association: MEMBER
submitted_at: 2025-03-12T07:31:43Z
user: login: victorvhs017
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-12T09:30:21Z
user: login: coderabbitai[bot]
body: **Actionable comments posted: 1**

<details>
<summary>🧹 Nitpick comments (1)</summary><blockquote>

<details>
<summary>turbo.json (1)</summary><blockquote>

`227-230`: **Verify Task Behavior for "db:up"**  
The `"db:up"` task is defined with cache disabled and no outputs, which is acceptable for a startup task that triggers container initialization. Ensure that this task reliably starts the required containers (including Redis and MinIO, as per the PR objectives) and consider documenting any required health checks or expected wait times in future improvements.

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**

<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 3b135f5ae92d96e560b0d2cc56d19c72fce2aecf and 3566ccd8d8eab31f2ea0a875e33ab6c5c0ad7767.

</details>

<details>
<summary>📒 Files selected for processing (4)</summary>

* `apps/web/cache-handler.mjs` (1 hunks)
* `package.json` (1 hunks)
* `packages/database/package.json` (1 hunks)
* `turbo.json` (2 hunks)

</details>

<details>
<summary>🚧 Files skipped from review as they are similar to previous changes (2)</summary>

* packages/database/package.json
* apps/web/cache-handler.mjs

</details>

<details>
<summary>⏰ Context from checks skipped due to timeout of 90000ms (4)</summary>

* GitHub Check: Run E2E Tests / Run E2E Tests
* GitHub Check: Build Formbricks-web / Build Formbricks-web
* GitHub Check: Analyze (javascript)
* GitHub Check: Tusk Tester

</details>

<details>
<summary>🔇 Additional comments (1)</summary><blockquote>

<details>
<summary>turbo.json (1)</summary>

`13-15`: **Ensure Correct Dependency Linking for Database Setup Task**  
The new task `"@formbricks/database#setup"` correctly depends on the `"db:up"` task. This dependency setup is clear and aligns with the objective of waiting for the database containers to be operational before proceeding.

</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-12T11:05:52Z
user: login: mattinannt
body: 😊🚀
state: APPROVED
author_association: MEMBER
submitted_at: 2025-03-17T09:33:01Z

Review comments:
diff_hunk: @@ -11,42 +11,38 @@ const createTimeoutPromise = (ms, rejectReason) => {
 CacheHandler.onCreation(async () => {
   let client;
 
-  if (process.env.REDIS_URL && process.env.ENTERPRISE_LICENSE_KEY) {
-    try {
-      // Create a Redis client.
-      client = createClient({
-        url: process.env.REDIS_URL,
-      });
+  try {
path: apps/web/cache-handler.mjs
user: login: mattinannt
body: We still support both Redis cache handler and simple in-memory cache so we should still check if REDIS_URL is present. Otherwise this will break on existing setups without Redis.
created_at: 2025-03-12T07:27:33Z
author_association: MEMBER
diff_hunk: @@ -276,7 +276,7 @@ Y
  ✔ Container formbricks-postgres-1    Started                                                                                                                                                    1.0s
  ✔ Container formbricks-formbricks-1  Started                                                                                                                                                    1.6s
  ✔ Container traefik                  Started                                                                                                                                                    2.8s
-🔗 To edit more variables and deeper config, go to the formbricks/docker-compose.yml, edit the file, and restart the container!
+🔗 To edit more variables and deeper config, go to the formbricks/docker/docker-compose.yml, edit the file, and restart the container!
path: docs/self-hosting/setup/one-click.mdx
user: login: mattinannt
body: The previous information was correct. This doesn't follow our repository structure, but the one click script creates a `formbricks` directory on the server and downloads the `docker-compose.yml` into this.
created_at: 2025-03-12T07:29:40Z
author_association: MEMBER
diff_hunk: @@ -13,10 +13,10 @@
     "db:create-saml-database:deploy": "env SAML_DATABASE_URL=\"${SAML_DATABASE_URL}\" tsx ./src/scripts/create-saml-database.ts",
     "db:create-saml-database:dev": "dotenv -e ../../.env -- tsx ./src/scripts/create-saml-database.ts",
     "db:push": "prisma db push --accept-data-loss",
-    "db:up": "docker compose up -d",
+    "db:up": "docker compose -f ../../docker-compose.dev.yml up -d",
path: packages/database/package.json
user: login: mattinannt
body: can we remove the commands from the database package and instead add them to the root `package.json` because this is necessary for the general dev environment and not specific to the postgres database?
created_at: 2025-03-12T07:31:02Z
author_association: MEMBER
diff_hunk: @@ -11,42 +11,38 @@ const createTimeoutPromise = (ms, rejectReason) => {
 CacheHandler.onCreation(async () => {
   let client;
 
-  if (process.env.REDIS_URL && process.env.ENTERPRISE_LICENSE_KEY) {
-    try {
-      // Create a Redis client.
-      client = createClient({
-        url: process.env.REDIS_URL,
-      });
+  try {
path: apps/web/cache-handler.mjs
user: login: victorvhs017
body: Good catch, fixed!
created_at: 2025-03-12T09:30:21Z
author_association: CONTRIBUTOR
diff_hunk: @@ -17,7 +17,9 @@
     "db:migrate:deploy": "turbo run db:migrate:deploy",
     "db:start": "turbo run db:start",
     "db:push": "turbo run db:push",
-    "go": "turbo run go --concurrency 20",
+    "db:up": "docker compose -f docker-compose.dev.yml up -d",
+    "db:down": "docker compose -f docker-compose.dev.yml down",
+    "go": "pnpm db:up && turbo run go --concurrency 20",
path: package.json
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

**Integrate New Database Startup Scripts into "go" Command**  
The addition of the `"db:up"` and `"db:down"` scripts is clear and fulfills the need to manage the development database services using the `docker-compose.dev.yml` file. Updating the `"go"` script to run `pnpm db:up && turbo run go --concurrency 20` ensures that all necessary containers are initiated before the application starts. Verify that error handling is sufficient if `db:up` fails and that all required services (e.g., Redis and MinIO) are properly configured in your Docker Compose file.

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-03-12T11:05:51Z
author_association: CONTRIBUTOR

PR comments:
user: login: vercel[bot]
created_at: 2025-03-10T15:16:50Z
body: [vc]: #IWO64iES9bAOp/sZEUeUbPAmeMjI4hDZLsbKa7p+FKs=:eyJpc01vbm9yZXBvIjp0cnVlLCJ0eXBlIjoiZ2l0aHViIiwicHJvamVjdHMiOlt7Im5hbWUiOiJmb3JtYnJpY2tzLWNsb3VkIiwibGl2ZUZlZWRiYWNrIjp7InJlc29sdmVkIjowLCJ1bnJlc29sdmVkIjowLCJ0b3RhbCI6MCwibGluayI6IiJ9LCJpbnNwZWN0b3JVcmwiOiJodHRwczovL3ZlcmNlbC5jb20vZm9ybWJyaWNrcy9mb3JtYnJpY2tzLWNsb3VkLzRyeDRDdWtuTUw2MkRwQXRQSHlrekdyV3ZGZnQiLCJuZXh0Q29tbWl0U3RhdHVzIjoiSUdOT1JFRCIsInJvb3REaXJlY3RvcnkiOiJhcHBzL3dlYiIsInByZXZpZXdVcmwiOiJmb3JtYnJpY2tzLWNsb3VkLWdpdC1mZWF0dXJlLWFkZC1yZWRpcy1hZGQtbWktN2M0ODliLWZvcm1icmlja3MudmVyY2VsLmFwcCJ9XX0=
**The latest updates on your projects**. Learn more about [Vercel for Git ↗︎](https://vercel.link/github-learn-more)


<details><summary>1 Skipped Deployment</summary>

| Name | Status | Preview | Comments | Updated (UTC) |
| :--- | :----- | :------ | :------- | :------ |
| **formbricks-cloud** | ⬜️ Ignored ([Inspect](https://vercel.com/formbricks/formbricks-cloud/4rx4CuknML62DpAtPHykzGrWvFft)) | [Visit Preview](https://formbricks-cloud-git-feature-add-redis-add-mi-7c489b-formbricks.vercel.app) |  | Mar 12, 2025 11:02am |
</details>


author_association: NONE
user: login: use-tusk[bot]
created_at: 2025-03-10T15:16:51Z
body: **⏩ No test scenarios generated (3566ccd8d8eab31f2ea0a875e33ab6c5c0ad7767)** [View output ↗](https://github.com/formbricks/formbricks/pull/4909/checks?check_run_id=38628490514)

<details><summary>View check history</summary>
<p>

| Commit | Status | Output | Tests | Passed | Failed | Error |
|--------|--------|--------|--------|--------|--------|--------|
| 3b135f5ae92d96e560b0d2cc56d19c72fce2aecf | ⏩ No test scenarios generated | [Output](https://app.usetusk.ai/app/testing-commit-check/f0331a88-3461-4979-bbcf-be1e52960b1b?client=ed5e7af5-f810-424e-a528-cd1b708b51aa) |  |  |  |  |
| 3566ccd8d8eab31f2ea0a875e33ab6c5c0ad7767 | ⏩ No test scenarios generated | [Output](https://app.usetusk.ai/app/testing-commit-check/82377099-67a2-4961-bd3b-8bd2a478d352?client=ed5e7af5-f810-424e-a528-cd1b708b51aa) |  |  |  |  |

</p>
</details>
author_association: CONTRIBUTOR
user: login: github-actions[bot]
created_at: 2025-03-10T15:17:04Z
body: Thank you for following the naming conventions for pull request titles! 🙏
<!-- Sticky Pull Request Commentpr-title-lint-error -->
author_association: CONTRIBUTOR
user: login: coderabbitai[bot]
created_at: 2025-03-10T15:19:17Z
body: <!-- This is an auto-generated comment: summarize by coderabbit.ai -->
<!-- walkthrough_start -->

## Walkthrough
The pull request makes several configuration and script changes. In the `.env.example` file, the previously commented-out `REDIS_URL` is now active. The `.gitpod/init.bash` script has been updated to source Docker images from `docker-compose.dev.yml` instead of the previous YAML file. Within the `apps/web/cache-handler.mjs`, the conditional requirement for an enterprise license key when creating a Redis client has been removed. A new file, `docker-compose.dev.yml`, has been introduced to define multiple development services (Postgres, Mailhog, Redis, and Minio) along with their volumes, while the older `packages/database/docker-compose.yml` file is removed. Additionally, database management scripts have been adjusted in both `packages/database/package.json` and `package.json` to integrate these configuration changes, and new tasks have been added in `turbo.json` to ensure the database setup runs prior to related operations.

## Possibly related PRs
- **formbricks/formbricks#4314**: Relates to the handling of the `REDIS_URL` configuration in both the `.env.example` and the Redis client creation logic.
- **formbricks/formbricks#4271**: Involves changes to Docker Compose configurations, linking closely to the removal of the old Compose file and updates to Redis-related settings.

## Suggested labels
`bug`

## Suggested reviewers
- mattinannt
- pandeymangg

<!-- walkthrough_end -->
<!-- This is an auto-generated comment: all tool run failures by coderabbit.ai -->

> [!WARNING]
> There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.
> 
> <details>
> <summary>🔧 ESLint</summary>
> 
> > If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.
> 
> Scope: all 2 workspace projects
>  ERR_PNPM_OPTIONAL_DEPS_REQUIRE_PROD_DEPS  Optional dependencies cannot be installed without production dependencies
> 
> 
> 
> </details>

<!-- end of auto-generated comment: all tool run failures by coderabbit.ai -->
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEYDEZyAAUASpADK2VmgqyjcEj2wAbb5AokAI7Y0riQ4rjedJAARABm8AAeXNjctNTRtPgMANaUkAlRkADu6rD+dKiY9MzwGPD4Chi42uQUiDElaMiI2AK1uDT0cpDYiPkS8GL4FBKwiAAMAIwA7OgY9KjwSs3wCdHd1nYYTgL5ACwAnAuXGjCwnrzwzC7ygiJikp74ceEIyLYUMgCKM0hk/p4ACLZPJ8QqeEF1BjebBKSBKOJoHxhGyVZDVSAAWTqAEkAPJNFp1SjIOIzdEkKTefDcNjNLwUbj4caIDRGElYXAPBmIBgUeDccT4DAAGghOCF9PweG81OBwoYsEwpGQLzRBN4+EmSmQTGaJESYTpfCFnlS6Rodw86FotHUDSwPwh40prRpQJQ5o20RBZC1GAYCOFSiZLLZYTIkwo0vjkBGZF64owRD+1Eg5EjiEQr0g41mU2k6ACFTQbu88jQEm03hUUSdwqxir4aG8iEaiG4oj28ErtvCoTqOcNkdo2ACwMaUnFcXkY812ukcuKCE1geRqM8FGwGHq2flTGcG0gAANuBhWZAiPhr+FGprRDkUL819KqW18dWLLKFKGA9us9A0Ig4hnmOaDcNwqoMNQHqQMySG+Kub7SgkFDMLmOJ4gGARMBQbpnuQxSQOw4rSHyBjOu+uSqlBe4okomyCsKgJ1G6SGQfh8qdrA9JaqaLAISQQyloyyh+AEwTwAEEHdDkiByr0u6HIUqpnsqYRjpB0E5uMnzSupJDeHEYABJMJClDBGqKCQcoEhmc6TgJtrVi4ngYI0xQuKeRDIPSZp9kUzLBTw87sO2nhCSJhw9n2kBsBQpAQc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N4LQiAqk2T7l0c963eXr/6lbmNnCzukCacGW3T+ruV0cqABkKkN4AAAl9D9MDKtVMmYBXaY/nM0//koIi+nfwIoRHdnS+P2zkHfD2zOnxEcm/Dko/cnqlQvM4wGGaEZJnqkNHPUko3Vj4OysSnemSle9HeECpOnCZIpgYhdgGJ7HXTndBwO/QpQnELCpVBEyQNVRxTPNeGWg8EO/pF08lPFKtgjsrCSzeHpP8i9VCmgE5i8sCGu1kJWH5GEIaG2+sG8HgAxz/r/JMcR31r0EQDqEZPQgGKqHkLQpFhXfwHwGmnoh3oJm4cnkNhx8gFx8AtgIpI8K1XAYExSd8L8PONiLyEYKzuyjUzBCpOLow269Q8nVEyuhE2wxZWuMjU8MbJsvIHSCViFAjhgOGAwDi2h5+Ke2nRGGLkJ80MHko48Wo5FxUOS50yTUhZCyIh1cg11Zy8Te2TyzItg/y8LrQ/ysK7q7ewKY9ZuwDNu39Fzfu2+5c6naZqGxe+cr46h4teOxW8W0ual+K49Sh210RzDqR3QsDj6JifR3gIx0zJhZKA2Lc8xw4v15O5mh4nDAYHTKosjL8CzLW1JJzM0NzGgLzMI/ICMGTMoJTGLDTJLHtwjGbeoAHNsIgAHDZCOEWrQAHFBC4GELt/t93AIEsN3PfnEPfmgCQJcM/rQJcJ3CQPfp3AsAIAsLQM/jNKj7QEsJcAwCsM/nEJGM/rDwwL8LTK95D53J3DNLQPQQz/VAIN3EsHEM/vVAsGgPQSsPfiQN3N3CoHT/fgwFz7QCsCsJ3GsCD699jO959995nHZHQAHEjBLHoEAA=== -->

<!-- internal state end -->
<!-- tips_start -->

---



<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=formbricks/formbricks&utm_content=4909):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
  - `I pushed a fix in commit <commit_id>, please review it.`
  - `Generate unit testing code for this file.`
  - `Open a follow-up GitHub issue for this discussion.`
- Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples:
  - `@coderabbitai generate unit testing code for this file.`
  -	`@coderabbitai modularize this function.`
- PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
  - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.`
  - `@coderabbitai read src/utils.ts and generate unit testing code.`
  - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.`
  - `@coderabbitai help me debug CodeRabbit configuration file.`

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

### CodeRabbit Commands (Invoked using PR comments)

- `@coderabbitai pause` to pause the reviews on a PR.
- `@coderabbitai resume` to resume the paused reviews.
- `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai full review` to do a full review from scratch and review all the files again.
- `@coderabbitai summary` to regenerate the summary of the PR.
- `@coderabbitai generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository.
- `@coderabbitai help` to get help.

### Other keywords and placeholders

- Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed.
- Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description.
- Add `@coderabbitai` anywhere in the PR title to generate the title automatically.

### CodeRabbit Configuration File (`.coderabbit.yaml`)

- You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository.
- Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json`

### Documentation and Community

- Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->
author_association: CONTRIBUTOR
user: login: sonarqubecloud[bot]
created_at: 2025-03-12T11:04:23Z
body: ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=formbricks_formbricks&pullRequest=4909) **Quality Gate passed**  
Issues  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=formbricks_formbricks&pullRequest=4909&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=formbricks_formbricks&pullRequest=4909&issueStatuses=ACCEPTED)

Measures  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=formbricks_formbricks&pullRequest=4909&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=formbricks_formbricks&pullRequest=4909&metric=new_coverage&view=list)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=formbricks_formbricks&pullRequest=4909&metric=new_duplicated_lines_density&view=list)  
  
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=formbricks_formbricks&pullRequest=4909)


author_association: NONE