-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (26 loc) · 1.51 KB
/
Dockerfile
File metadata and controls
36 lines (26 loc) · 1.51 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
# Build and test the SDK monorepo (governance + governance-platform).
# Use for CI or as a base image. Not required for running the API (API pulls packages from registry).
# ─── Builder ────────────────────────────────────────────────────
FROM node:22-alpine AS builder
WORKDIR /app
COPY package.json package-lock.json* ./
RUN npm ci 2>/dev/null || npm install
COPY packages ./packages/
RUN npm run build
# ─── Test (optional: docker build --target test) ────────────────
FROM builder AS test
RUN npm test
# ─── Runtime ────────────────────────────────────────────────────
FROM node:22-alpine AS runtime
WORKDIR /app
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
COPY --from=builder /app/package.json /app/package-lock.json* ./
COPY --from=builder /app/node_modules ./node_modules/
COPY --from=builder /app/packages/governance/dist ./packages/governance/dist/
COPY --from=builder /app/packages/governance/package.json ./packages/governance/
COPY --from=builder /app/packages/governance-platform/dist ./packages/governance-platform/dist/
COPY --from=builder /app/packages/governance-platform/package.json ./packages/governance-platform/
USER appuser
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD node -e "process.exit(0)"
EXPOSE 4000