Repository navigation
Expand file tree
/
Copy pathDockerfile.everk8s
More file actions
48 lines (34 loc) · 1.71 KB
/
Copy pathDockerfile.everk8s
File metadata and controls
48 lines (34 loc) · 1.71 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# syntax=docker/dockerfile:1
# ever-traduora-docs — Docusaurus v3 static docs site (docs.traduora.co)
# Build context = repo root. The site in docs-website/ resolves its content from
# ../docs (docusaurus.config.ts -> presets.docs.path = '../docs/').
# Output of `docusaurus build` -> docs-website/build. Served as static files by nginx.
# ---- Build stage ----
FROM node:26.12.1-alpine AS builder
# git + build toolchain for any native deps pulled by the Docusaurus toolchain.
RUN apk add --no-cache git python3 make g++ bash libc6-compat
WORKDIR /app
# Docusaurus reads docs content from ../docs relative to the website dir, so copy both.
COPY docs ./docs
COPY docs-website ./docs-website
WORKDIR /app/docs-website
# Prefer the internal Verdaccio cache (VERDACCIO_REGISTRY build-arg, anonymous) when provided,
# else fall back to the public npm registry pinned in .npmrc (e.g. a fork). Appending wins over
# the committed default because the last registry line in .npmrc takes precedence.
ARG VERDACCIO_REGISTRY=""
RUN if [ -n "$VERDACCIO_REGISTRY" ]; then \
echo "registry=${VERDACCIO_REGISTRY}" >> .npmrc; \
fi
# Install deps (reproducible when the lockfile is present; tolerate drift on a fork).
RUN npm ci --no-audit --no-fund || npm install --no-audit --no-fund
# Build the static site -> /app/docs-website/build
RUN npm run build
# ---- Runtime stage ----
FROM nginx:alpine
# Docusaurus v3 emits per-route directories with index.html; nginx.conf handles clean URLs.
COPY docs-website/nginx.conf /etc/nginx/conf.d/default.conf
# Copy the generated static site (v3 output dir = build/)
COPY --from=builder /app/docs-website/build /usr/share/nginx/html
EXPOSE 80
STOPSIGNAL SIGQUIT
CMD ["nginx", "-g", "daemon off;"]