Add docker compose for dev

This commit is contained in:
Ruslan Bakiev
2026-02-18 14:01:21 +07:00
parent efa0b79c4c
commit e5eb5839b1
2 changed files with 51 additions and 0 deletions

View File

@@ -18,3 +18,17 @@ cd Frontend
npm install npm install
npm run dev npm run dev
``` ```
## Run (Docker Compose)
Prereqs: Docker Desktop (compose v2).
```bash
docker compose up --build
```
Open: `http://localhost:3000/`
Notes:
- DB is SQLite persisted in a named volume (`clientsflow_data`).
- For LangGraph agent: set `OPENAI_API_KEY` (otherwise it falls back to the rule-based agent).

37
compose.yaml Normal file
View File

@@ -0,0 +1,37 @@
services:
frontend:
image: node:22-bookworm-slim
working_dir: /app/Frontend
volumes:
- .:/app
- clientsflow_data:/app/.data
ports:
- "3000:3000"
environment:
DATABASE_URL: "file:../../.data/clientsflow-dev.db"
REDIS_URL: "redis://redis:6379"
CF_AGENT_MODE: "langgraph"
OPENAI_MODEL: "gpt-4o-mini"
# Set this in your shell or a compose override:
# OPENAI_API_KEY: "..."
command: >
bash -lc "
npm ci &&
npx prisma db push --force-reset &&
node prisma/seed.mjs &&
npm run dev -- --host 0.0.0.0 --port 3000
"
depends_on:
- redis
redis:
image: redis:7-alpine
ports:
- "6379:6379"
volumes:
- redis_data:/data
volumes:
clientsflow_data:
redis_data: