Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (25 loc) · 1.42 KB
/
Copy pathDockerfile
File metadata and controls
31 lines (25 loc) · 1.42 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
# Build the static export once, on the build machine's own platform (the output
# is the same for every platform), then serve it with nginx.
FROM --platform=$BUILDPLATFORM docker.io/library/node:22.23.3-alpine@sha256:0a7108bf6c7bf5de370ffb1a3ed6be93d405b43ff159f681a8d18c0e2bc2e402 AS build
WORKDIR /src
ENV NEXT_TELEMETRY_DISABLED=1
COPY package.json package-lock.json ./
RUN npm ci --ignore-scripts --no-audit --no-fund
COPY . .
RUN npm run build
FROM docker.io/library/nginx:1.31.6-alpine@sha256:df221db836e1754089190208cee7eeda94f233197056426eda74a43ab1abeac2
LABEL org.opencontainers.image.source="https://github.com/bitop-dev/omp-docs" \
org.opencontainers.image.description="Open MCP Portal documentation (static site)" \
org.opencontainers.image.licenses="MIT AND CC-BY-4.0"
# Our own nginx.conf: pid, logs and temp files under /tmp (read-only root
# filesystem friendly). Our default.conf replaces the image's. No RUN steps in
# this stage, so a multi-platform build needs no emulation.
COPY nginx/nginx.conf /etc/nginx/nginx.conf
COPY nginx/default.conf /etc/nginx/conf.d/default.conf
COPY nginx/security-headers.conf /etc/nginx/snippets/security-headers.conf
COPY --from=build --chown=101:101 /src/out /usr/share/nginx/html
USER 101:101
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget -q -O /dev/null http://127.0.0.1:8080/healthz || exit 1
CMD ["nginx", "-g", "daemon off;"]