-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (21 loc) · 802 Bytes
/
Dockerfile
File metadata and controls
29 lines (21 loc) · 802 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
############################################
# Builder stage: install deps and build site
############################################
FROM python:3.11-slim AS builder
WORKDIR /site
# Install build dependencies
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
# Copy source and build static site
COPY . .
RUN mkdocs build --strict
############################################
# Runtime stage: serve static site via Nginx
############################################
FROM nginx:alpine AS runtime
# Copy built site to Nginx html directory
COPY --from=builder /site/site /usr/share/nginx/html
EXPOSE 80
# Optional: healthcheck (Nginx default index)
HEALTHCHECK CMD wget -qO- http://localhost/ >/dev/null 2>&1 || exit 1
# Start Nginx (default CMD provided by base image)