diff --git a/README.md b/README.md index 7e6f867..2e8ae3e 100644 --- a/README.md +++ b/README.md @@ -18,3 +18,17 @@ cd Frontend npm install 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). diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..b6f60aa --- /dev/null +++ b/compose.yaml @@ -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: +