-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathdocs.Dockerfile
More file actions
33 lines (23 loc) · 1.12 KB
/
docs.Dockerfile
File metadata and controls
33 lines (23 loc) · 1.12 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
# Dockerfile.docs
# Builds and serves the Dory documentation site.
#
# Build: docker build -f Dockerfile.docs -t dory-docs .
# Run: docker run -p 80:80 dory-docs
# ─── Stage 1: Build ───────────────────────────────────────────────────────────
FROM node:24.11.1-alpine3.22 AS builder
RUN corepack enable && corepack prepare pnpm@10.10.0 --activate
WORKDIR /app
# Install dependencies first (cached layer)
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
# Copy source and build
COPY . .
RUN pnpm run build:docs
# ─── Stage 2: Serve ───────────────────────────────────────────────────────────
FROM nginx:1.27-alpine AS runtime
# Copy built site
COPY --from=builder /app/dist /usr/share/nginx/html
# Copy nginx config (handles SPA routing with try_files)
COPY k8s/config/nginx-default.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]