-
Notifications
You must be signed in to change notification settings - Fork 70
Expand file tree
/
Copy pathDockerfile.docs
More file actions
36 lines (32 loc) · 1.1 KB
/
Copy pathDockerfile.docs
File metadata and controls
36 lines (32 loc) · 1.1 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
# Build + serve the VitePress docs site (coolify-mcp.stumason.dev).
# Multi-stage: node:22-alpine for the build, nginx:1.27-alpine for the serve.
#
# Preserves the repo layout (/app/site + /app/CHANGELOG.md) so the
# `<!--@include: ../CHANGELOG.md-->` directive in site/changelog.md resolves.
FROM node:22-alpine AS builder
WORKDIR /app/site
COPY site/package.json site/package-lock.json ./
RUN npm ci
WORKDIR /app
COPY CHANGELOG.md ./CHANGELOG.md
COPY site/ ./site/
WORKDIR /app/site
RUN npm run build
FROM nginx:1.27-alpine
COPY --from=builder /app/site/.vitepress/dist /usr/share/nginx/html
# VitePress generates cleanUrls — nginx needs a small rewrite to serve
# `/foo` as `/foo.html` when no index.html exists at that path.
RUN printf '%s\n' \
'server {' \
' listen 80;' \
' server_name _;' \
' root /usr/share/nginx/html;' \
' index index.html;' \
' location / {' \
' try_files $uri $uri.html $uri/ =404;' \
' }' \
' gzip on;' \
' gzip_types text/css application/javascript application/json image/svg+xml;' \
' gzip_min_length 256;' \
'}' > /etc/nginx/conf.d/default.conf
EXPOSE 80