mirror of
https://github.com/escalante29/WealthySmart.git
synced 2026-05-19 09:28:47 +02:00
Fix prod frontend container: tsx on PATH and cap build heap
All checks were successful
Deploy to VPS / deploy (push) Successful in 5s
All checks were successful
Deploy to VPS / deploy (push) Successful in 5s
Runner stage was invoking `tsx server.ts` via sh, which doesn't have node_modules/.bin on PATH, so the container crash-looped with "tsx: not found" (502 at the edge). Use the absolute binary path instead. Also caps the Vite build's V8 heap to 1.5 GB so a future build on the 4-core / 8 GB VPS can't OOM-kill neighbouring services. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -21,6 +21,8 @@ FROM node:22-alpine AS builder
|
||||
WORKDIR /app
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY . .
|
||||
# Cap node heap so a build on a small VPS can't OOM-kill neighbours.
|
||||
ENV NODE_OPTIONS=--max-old-space-size=1536
|
||||
RUN corepack enable && pnpm build
|
||||
|
||||
# Production: Hono serves dist/ + /api/copilotkit on port 3000
|
||||
@@ -34,4 +36,4 @@ COPY server.ts package.json ./
|
||||
EXPOSE 3000
|
||||
HEALTHCHECK --interval=30s --timeout=3s --retries=3 \
|
||||
CMD wget -qO- http://127.0.0.1:3000/api/health || exit 1
|
||||
CMD ["sh", "-c", "corepack enable && tsx server.ts"]
|
||||
CMD ["./node_modules/.bin/tsx", "server.ts"]
|
||||
|
||||
Reference in New Issue
Block a user