-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (25 loc) · 725 Bytes
/
Copy pathDockerfile
File metadata and controls
32 lines (25 loc) · 725 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
27
28
29
30
31
32
# ── Build stage ──
FROM node:22-alpine AS builder
WORKDIR /app
ARG VITE_MSAL_CLIENT_ID
ARG VITE_MSAL_AUTHORITY
ENV VITE_MSAL_CLIENT_ID=$VITE_MSAL_CLIENT_ID
ENV VITE_MSAL_AUTHORITY=$VITE_MSAL_AUTHORITY
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
RUN npm run build
# ── Production stage ──
FROM node:22-alpine
WORKDIR /app
# Install only production deps + tsx (needed for server)
COPY package.json package-lock.json ./
RUN npm ci --omit=dev && npm install tsx
# Copy built frontend and server source
COPY --from=builder /app/dist ./dist
COPY server ./server
COPY tsconfig.server.json ./
ENV NODE_ENV=production
ENV PORT=3000
EXPOSE 3000
CMD ["node", "--import", "tsx", "server/index.ts"]