formbricks / formbricks

Open Source Survey Platform
https://formbricks.com
Other
5.9k stars 953 forks source link

[BUG] Docker-Compose Deprecation Error in Local Dev Environment #2730

Closed beonma closed 3 weeks ago

beonma commented 3 weeks ago

Issue Summary

While working on the project, I opted to utilize the local development environment. After cloning the repository and installing the necessary packages, I attempted to initiate the development environment with the pnpm go command, which relies on Docker. However, the command failed. Upon investigation, I discovered that the failure was due to the deprecation of the docker-compose command in newer versions of Docker.

Steps to Reproduce

  1. Clone the repo
  2. pnpm install
  3. Set value of ENCRYPTION_KEY
  4. pnpm go

Expected behavior

should start a development environment.

Other information

Below is a basic solution I made to address the issue in the scripts property of packages/databse/package.json:

    "db:push": "prisma db push --accept-data-loss",
-   "db:up": "docker-compose up -d",
+   "db:up": "docker-compose up -d || docker compose up -d",
    "db:setup": "pnpm db:up && pnpm db:migrate:dev",
    "db:start": "pnpm db:setup",
-   "db:down": "docker-compose down",
+   "db:down": "docker-compose down || docker compose down",
    "format": "prisma format",
    "generate": "prisma generate",
    "lint": "eslint ./src --fix",
    "post-install": "pnpm generate",
    "predev": "pnpm generate",

I'm not sure if this will suffice for now, but at least I haven't encountered any noticeable issues thus far.

Screenshots

No response

Environment

Desktop (please complete the following information)

- OS: Ubuntu 22.04.4 LTS
- Node: v20.13.1
- npm: 10.5.2
github-actions[bot] commented 3 weeks ago

Thank you for opening your first issue! 🙏❤️ One of our team members will review it and get back to you as soon as it possible. 😊

mattinannt commented 3 weeks ago

@beonma thanks for raising an issue an proposing a solution 😊 Can you maybe open a PR wit these changes? I think we can also fully move over to the new “docker compose” command without supporting the old one. In dev environments it’s easier for us to enforce this 😊

beonma commented 3 weeks ago

Hey @mattinannt ! for sure, I've submitted a pull request with the mentioned changes, including updates to a documentation file. Please feel free to make any necessary additions or deletions as you see fit.