-
Notifications
You must be signed in to change notification settings - Fork 72
Expand file tree
/
Copy pathDockerfile.webapp
More file actions
33 lines (31 loc) · 1.25 KB
/
Dockerfile.webapp
File metadata and controls
33 lines (31 loc) · 1.25 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
FROM node:24-alpine AS deps
WORKDIR /app
COPY package.json package-lock.json ./
COPY packages/core/package.json ./packages/core/package.json
COPY packages/core/src ./packages/core/src
COPY webapp/backend/package.json ./webapp/backend/package.json
COPY webapp/backend/package-lock.json ./webapp/backend/package-lock.json
RUN npm ci --ignore-scripts
RUN cd ./webapp/backend && npm ci
FROM node:24-alpine AS build
WORKDIR /app
COPY --from=deps /app /app
COPY webapp/backend/esbuild.config.js ./webapp/backend/esbuild.config.js
COPY webapp/backend/src ./webapp/backend/src
RUN cd ./webapp/backend && node esbuild.config.js
FROM node:24-alpine
RUN apk add --no-cache git
WORKDIR /app/webapp/backend
COPY webapp/backend/package.json ./package.json
COPY --from=deps /app/webapp/backend/node_modules ./node_modules
COPY --from=deps /app/node_modules /app/node_modules
COPY --from=build /app/webapp/backend/dist ./dist
COPY webapp/frontend/ /app/frontend/
ENV REPORTS_DIR=/app/data/reports
RUN mkdir -p /app/data \
&& chown -R node:node /app
USER node
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=10s --start-period=15s --retries=3 \
CMD node -e "fetch('http://localhost:3000/api/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"
CMD ["node", "dist/server.js"]