-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (34 loc) · 958 Bytes
/
Copy pathDockerfile
File metadata and controls
47 lines (34 loc) · 958 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# syntax=docker/dockerfile:1.7
FROM node:24-bookworm-slim AS deps
WORKDIR /app
COPY package.json package-lock.json ./
COPY frontend/package.json frontend/package-lock.json ./frontend/
RUN npm ci \
&& cd frontend \
&& npm ci
FROM deps AS build
WORKDIR /app
COPY assets ./assets
COPY public ./public
COPY scripts ./scripts
COPY src ./src
COPY templates ./templates
COPY frontend ./frontend
COPY tsconfig.json vitest.config.ts ./
RUN npm run build
FROM node:24-bookworm-slim AS runtime
WORKDIR /app
ENV NODE_ENV=production
ENV HEXNEST_WEB_HOST=0.0.0.0
ENV HEXNEST_WEB_PORT=3000
ENV HEXNEST_WEB_PORT_STRICT=true
COPY package.json package-lock.json ./
RUN npm ci --omit=dev \
&& npm cache clean --force
COPY --from=build /app/dist ./dist
COPY --from=build /app/frontend/dist ./frontend/dist
COPY --from=build /app/public ./public
COPY --from=build /app/templates ./templates
RUN mkdir -p /app/data
EXPOSE 3000
CMD ["node", "dist/src/index.js"]