diff --git a/deploy.sh b/deploy.sh index c1378a6..2e6e668 100755 --- a/deploy.sh +++ b/deploy.sh @@ -21,8 +21,12 @@ deploy_frontend() { echo "==> [frontend] Building locally..." (cd frontend && pnpm run build) - echo "==> [frontend] Uploading build/..." + echo "==> [frontend] Uploading build/ and package files..." rsync -az --delete frontend/build/ "$SERVER:$REMOTE/frontend/build/" + rsync -az frontend/package.json frontend/pnpm-lock.yaml "$SERVER:$REMOTE/frontend/" + + echo "==> [frontend] Installing production dependencies on server..." + ssh "$SERVER" "cd $REMOTE/frontend && pnpm install --prod --frozen-lockfile" echo "==> [frontend] Restarting service..." ssh "$SERVER" "sudo systemctl restart innercontext-node && echo OK" diff --git a/docs/DEPLOYMENT.md b/docs/DEPLOYMENT.md index f33d219..1eb7005 100644 --- a/docs/DEPLOYMENT.md +++ b/docs/DEPLOYMENT.md @@ -69,10 +69,12 @@ curl -LsSf https://astral.sh/uv/install.sh | UV_INSTALL_DIR=/usr/local/bin sh Installing to `/usr/local/bin` makes `uv` available system-wide (required for `sudo -u innercontext uv sync`). -### Node.js 24 LTS +### Node.js 24 LTS + pnpm -The server only needs Node.js to **run** the pre-built frontend bundle. -`pnpm` is **not** needed on the server — the frontend is always built locally. +The server needs Node.js to **run** the pre-built frontend bundle, and pnpm to +**install production runtime dependencies** (`clsx`, `bits-ui`, etc. — +`adapter-node` bundles the SvelteKit framework but leaves these external). +The frontend is never **built** on the server. ```bash curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bash @@ -88,6 +90,15 @@ Use `--remove-destination` to replace any existing symlink with a real file: cp --remove-destination "$(nvm which current)" /usr/local/bin/node ``` +Install pnpm as a standalone binary — self-contained, no wrapper scripts, +works system-wide: + +```bash +curl -fsSL "https://github.com/pnpm/pnpm/releases/latest/download/pnpm-linux-x64" \ + -o /usr/local/bin/pnpm +chmod 755 /usr/local/bin/pnpm +``` + ### Application user ```bash