-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
55 lines (40 loc) · 1.47 KB
/
Dockerfile
File metadata and controls
55 lines (40 loc) · 1.47 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# ---- Stage 1: Build ----
FROM node:24-slim AS build
WORKDIR /app
# Copy package files for dependency install
COPY package.json package-lock.json ./
COPY packages/server/package.json packages/server/
COPY packages/client/package.json packages/client/
COPY tsconfig.base.json ./
# Install all dependencies (including devDependencies for build)
RUN npm ci
# Copy source code
COPY packages/server/ packages/server/
COPY packages/client/ packages/client/
# Build server (tsup) and client (vite)
RUN npm run build -w packages/server
RUN npm run build -w packages/client
# ---- Stage 2: Runtime ----
FROM node:24-slim
WORKDIR /app
# Copy package files and install production dependencies only
COPY package.json package-lock.json ./
COPY packages/server/package.json packages/server/
COPY packages/client/package.json packages/client/
RUN npm ci --omit=dev
# Install Firefox via Playwright. Recreation.gov whitelists Firefox,
# avoiding the "outdated browser" banner that Chromium triggers.
RUN npx -w packages/server playwright install --with-deps firefox
# Copy built artifacts from build stage
COPY --from=build /app/packages/server/dist packages/server/dist
COPY --from=build /app/packages/client/dist packages/client/dist
# Copy tsconfig for any runtime needs
COPY tsconfig.base.json ./
# Create data directory
RUN mkdir -p /data
ENV NODE_ENV=production
ENV PORT=3001
ENV DATA_DIR=/data
ENV CLIENT_DIST_PATH=/app/packages/client/dist
EXPOSE 3001
CMD ["node", "packages/server/dist/index.js"]