From 80076012c6d3840b7faee23f9a1dd5c09849bb8d Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Sun, 20 Jul 2025 21:27:02 -0700 Subject: [PATCH] fix(docker): fixed docker container healthchecks, added instructions to README for pgvector (#735) * fixed docker container healthchecks * add additional instructions for pgvector extension to README --- README.md | 39 ++++++++++++++++++++++++++++++++++----- docker-compose.local.yml | 2 +- docker-compose.prod.yml | 2 +- 3 files changed, 36 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 8617c6c8b..7ecbe7f27 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,12 @@ docker compose -f docker-compose.prod.yml up -d ### Option 4: Manual Setup +**Requirements:** +- [Bun](https://bun.sh/) runtime +- PostgreSQL 12+ with [pgvector extension](https://github.com/pgvector/pgvector) (required for AI embeddings) + +**Note:** Sim Studio uses vector embeddings for AI features like knowledge bases and semantic search, which requires the `pgvector` PostgreSQL extension. + 1. Clone and install dependencies: ```bash @@ -99,20 +105,43 @@ cd sim bun install ``` -2. Set up environment: +2. Set up PostgreSQL with pgvector: + +You need PostgreSQL with the `vector` extension for embedding support. Choose one option: + +**Option A: Using Docker (Recommended)** +```bash +# Start PostgreSQL with pgvector extension +docker run --name simstudio-db \ + -e POSTGRES_PASSWORD=your_password \ + -e POSTGRES_DB=simstudio \ + -p 5432:5432 -d \ + pgvector/pgvector:pg17 +``` + +**Option B: Manual Installation** +- Install PostgreSQL 12+ and the pgvector extension +- See [pgvector installation guide](https://github.com/pgvector/pgvector#installation) + +3. Set up environment: ```bash cd apps/sim cp .env.example .env # Configure with required variables (DATABASE_URL, BETTER_AUTH_SECRET, BETTER_AUTH_URL) ``` -3. Set up the database: - +Update your `.env` file with the database URL: ```bash -bunx drizzle-kit push +DATABASE_URL="postgresql://postgres:your_password@localhost:5432/simstudio" ``` -4. Start the development servers: +4. Set up the database: + +```bash +bunx drizzle-kit migrate +``` + +5. Start the development servers: **Recommended approach - run both servers together (from project root):** diff --git a/docker-compose.local.yml b/docker-compose.local.yml index 4882859e6..3a23fe43d 100644 --- a/docker-compose.local.yml +++ b/docker-compose.local.yml @@ -57,7 +57,7 @@ services: limits: memory: 8G healthcheck: - test: ['CMD', 'wget', '--spider', '--quiet', 'http://127.0.0.1:3002'] + test: ['CMD', 'wget', '--spider', '--quiet', 'http://127.0.0.1:3002/health'] interval: 90s timeout: 5s retries: 3 diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index c21f3769d..532ed7a64 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -55,7 +55,7 @@ services: db: condition: service_healthy healthcheck: - test: ['CMD', 'wget', '--spider', '--quiet', 'http://127.0.0.1:3002'] + test: ['CMD', 'wget', '--spider', '--quiet', 'http://127.0.0.1:3002/health'] interval: 90s timeout: 5s retries: 3