All checks were successful
CI — Website / Website — typecheck, build (pull_request) Successful in 1m1s
Nixpacks built Vite but had no production start command, so Coolify returned Cannot GET /. Co-authored-by: Cursor <cursoragent@cursor.com>
69 lines
2.7 KiB
Markdown
69 lines
2.7 KiB
Markdown
# LexAI website
|
||
|
||
Marketing site for the LexAI monorepo: Home, Docs, Contribute, Community.
|
||
|
||
## Develop
|
||
|
||
```bash
|
||
# from repo root
|
||
npm run website:install
|
||
npm run website:dev
|
||
```
|
||
|
||
Or inside this package:
|
||
|
||
```bash
|
||
npm install
|
||
npm run dev
|
||
```
|
||
|
||
## Build
|
||
|
||
```bash
|
||
npm run website:build
|
||
# → packages/website/dist/
|
||
```
|
||
|
||
Preview production build locally: `npm run website:preview` (Vite, localhost only).
|
||
|
||
Production start (what Coolify should run): `npm start` — serves `dist/` on `0.0.0.0:$PORT` (default 3000).
|
||
|
||
Uses HashRouter so deep links work even without SPA rewrite rules. The production server still maps unknown paths to `index.html`.
|
||
|
||
## Deploy on Coolify
|
||
|
||
This package is a static Vite build. No LexAI API keys or env vars. Do not add `LEXAI_API_KEY`.
|
||
|
||
`Cannot GET /` means Coolify started a Node process that is not serving `dist/` (no `start` command, or "static site" pointed at the wrong folder). Fix: use one of the two setups below, then **Redeploy**.
|
||
|
||
**Required on either setup**
|
||
|
||
1. **+ New** → **Resource** → **Private Repository (with deploy key)** (Gitea).
|
||
2. Repo SSH URL, for example `git@git.juankibin.space:kibin/LexAI.git`. If Gitea SSH is not on port 22, use `ssh://git@git.juankibin.space:PORT/kibin/LexAI.git`.
|
||
3. Add Coolify’s public deploy key to the Gitea repo: **Settings → Deploy / Access Keys** (read-only).
|
||
4. Branch: `dev` or `main`.
|
||
5. **Base Directory:** `packages/website` — no leading slash. Root `npm run build` builds Chrome, not this site.
|
||
6. Optional **Watch Paths:** `packages/website`.
|
||
7. Set the domain, deploy, open `https://your-domain/` (docs: `https://your-domain/#/docs`).
|
||
|
||
### Option A — Dockerfile (recommended)
|
||
|
||
1. **Build Pack:** Dockerfile.
|
||
2. Leave **Is it a static site?** **off**.
|
||
3. **Ports Exposes:** `80`.
|
||
4. If Coolify asks for a Dockerfile path: `packages/website/Dockerfile` (or omit it when Base Directory is already `packages/website`).
|
||
|
||
### Option B — Nixpacks
|
||
|
||
1. **Build Pack:** Nixpacks.
|
||
2. Leave **Is it a static site?** **off**. Nixpacks runs `npm run build` then `node server.mjs`.
|
||
3. **Start command** (if the field is shown): `npm start` or `node server.mjs`.
|
||
4. **Ports Exposes:** `3000`.
|
||
5. Optional env: `NIXPACKS_NODE_VERSION=22`. Do not set `NODE_ENV=production` at **build** time — Vite is a devDependency and `npm ci` would skip it.
|
||
|
||
Do **not** tick "Is it a static site?" with Publish Directory `/dist`. The leading slash is an absolute path (`/dist` on the container), which is empty, and Coolify then answers `Cannot GET /`.
|
||
|
||
If you already created the resource: uncheck static site, set Base Directory and port as above, then Redeploy (no need to recreate the app).
|
||
|
||
Auto-deploy: Coolify resource → **Webhooks** → copy the URL + secret into Gitea **Settings → Webhooks** (push events).
|