1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 |
# Build the static site, then serve it with the zero-dependency Node server.
# ---- build ----
FROM node:20-alpine AS build
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
RUN npm run build
# ---- run ----
FROM node:20-alpine AS run
WORKDIR /app
ENV NODE_ENV=production HOST=0.0.0.0 PORT=11711
COPY --from=build /app/dist ./dist
COPY server.mjs ./
EXPOSE 11711
USER node
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s \
CMD wget -q --spider http://127.0.0.1:11711/ || exit 1
CMD ["node", "server.mjs"]
|