File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11node_modules /
2+ dist /
23.env
34data /
45temp /
Original file line number Diff line number Diff line change 11# ── Build stage ───────────────────────────────────────────────────────────────
2- FROM node:18-alpine AS deps
2+ # Installs all deps (including devDeps for esbuild), transpiles public/ → dist/
3+ # for Chrome 69 / older Android WebView, then prunes devDeps before handoff.
4+ FROM node:18-alpine AS build
35
46WORKDIR /app
57
68# python3/make/g++ are required to compile the native bcrypt addon
79RUN apk add --no-cache python3 make g++
810
911COPY package*.json ./
10- RUN npm ci --omit=dev
12+ RUN npm ci
13+
14+ COPY . .
15+ RUN npm run build
16+ RUN npm prune --omit=dev
1117
1218# ── Runtime stage ─────────────────────────────────────────────────────────────
1319FROM node:18-alpine
@@ -18,8 +24,10 @@ WORKDIR /app
1824RUN addgroup -S codexa && adduser -S codexa -G codexa && \
1925 apk add --no-cache su-exec
2026
21- # Copy deps and source
22- COPY --from=deps /app/node_modules ./node_modules
27+ # Production node_modules (devDeps already pruned) + transpiled dist/
28+ COPY --from=build /app/node_modules ./node_modules
29+ COPY --from=build /app/dist ./dist
30+ # Source files (public/ kept as server-side fallback; dist/ wins at runtime)
2331COPY . .
2432
2533# Data directory — mount a named volume here for persistence
You can’t perform that action at this time.
0 commit comments