-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
26 lines (24 loc) · 885 Bytes
/
Copy pathDockerfile
File metadata and controls
26 lines (24 loc) · 885 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# ---- Build & verify stage: run checks + compile the frontend ----
# Building this stage in CI validates lint + tests + the production build
# inside a reproducible container (the same thing that ships to runtime).
FROM node:24-alpine AS build
WORKDIR /app
RUN corepack enable
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
COPY . .
RUN pnpm lint && pnpm test && pnpm build
# ---- Runtime stage: one container serves the frontend + /api/chat proxy ----
FROM node:24-alpine
WORKDIR /app
ENV NODE_ENV=production
ENV PORT=3000
RUN corepack enable
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile --prod
COPY --from=build /app/dist ./dist
COPY server ./server
EXPOSE 3000
# The server serves the built frontend AND proxies /api/chat to Gemini.
# Provide the key at runtime: docker run -e GEMINI_API_KEY=...
CMD ["node", "server/index.mjs"]