-
Notifications
You must be signed in to change notification settings - Fork 69
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (26 loc) · 864 Bytes
/
Dockerfile
File metadata and controls
36 lines (26 loc) · 864 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
# ----------------------
# 1. Build stage
# ----------------------
FROM node:22-alpine AS builder
# Git is required because docs/package.json pulls a dependency from GitHub.
RUN apk add --no-cache git openssh-client
WORKDIR /app/docs
# Copy dependency manifests first to preserve Docker layer caching.
COPY docs/ ./
RUN npm ci
# Increase max-old-space-size to avoid memory issues during build
ENV NODE_OPTIONS="--max-old-space-size=8192"
# Build the site.
RUN npm run docs:build
# ----------------------
# 2. Runtime stage (nginx)
# ----------------------
FROM nginx:1.27-alpine AS runner
# Copy built files
COPY --from=builder /app/docs/.vitepress/dist /usr/share/nginx/html
# Expose port
EXPOSE 80
# Health check (optional)
HEALTHCHECK CMD wget --quiet --tries=1 --spider http://localhost:80/ || exit 1
# Start nginx
CMD ["nginx", "-g", "daemon off;"]