-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (21 loc) · 1.07 KB
/
Copy pathDockerfile
File metadata and controls
30 lines (21 loc) · 1.07 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
# ── Stage 1: build ──────────────────────────────────────────────────
FROM node:24-slim AS build
WORKDIR /app
COPY package.json package-lock.json tsconfig.json ./
RUN npm ci --ignore-scripts
COPY src/ src/
RUN npx tsc -p tsconfig.json
# ── Stage 2: production ────────────────────────────────────────────
FROM node:24-slim AS production
WORKDIR /app
ENV NODE_ENV=production
RUN addgroup --system openrna && adduser --system --ingroup openrna openrna
COPY package.json package-lock.json ./
RUN apt-get update && apt-get install -y --no-install-recommends curl && rm -rf /var/lib/apt/lists/*
RUN npm ci --omit=dev --ignore-scripts && npm cache clean --force
COPY --from=build /app/dist/ dist/
USER openrna
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD curl --fail --silent http://localhost:3000/healthz || exit 1
CMD ["node", "dist/src/index.js"]