-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
55 lines (43 loc) · 1.59 KB
/
Copy pathDockerfile
File metadata and controls
55 lines (43 loc) · 1.59 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
49
50
51
52
53
54
55
# Multi-stage Dockerfile for Sphinx blog with static HTML output
# Stage 1: Build the blog HTML
# Stage 2: Serve static content with quay.io/epheo/kiss
# =============================================================================
# Stage 1: Builder - Build the blog HTML
# =============================================================================
FROM fedora:44 AS builder
# Install system dependencies for building
RUN dnf update -y && \
dnf install -y \
python3 \
make \
git \
chromium-headless \
nodejs \
npm \
uv \
&& dnf clean all
# Install Mermaid CLI globally
RUN npm install -g @mermaid-js/mermaid-cli
# Configure UV for optimal container builds
ENV UV_COMPILE_BYTECODE=1 \
UV_LINK_MODE=copy \
UV_PROJECT_ENVIRONMENT=.venv
# Set working directory
WORKDIR /app
# Copy dependency files first (for better caching)
COPY pyproject.toml uv.lock ./
# Install dependencies only (not the project itself)
RUN uv sync --frozen --no-install-project
# Copy Mermaid and Puppeteer configuration files
COPY mermaid-config.json puppeteer-config.json ./
# Copy source code (do this last to maximize cache hits)
COPY . .
# Add virtual environment to PATH for build
ENV PATH="/app/.venv/bin:$PATH"
# Build the blog HTML
RUN make clean html
# =============================================================================
# Stage 2: Production - Static content with quay.io/epheo/kiss
# =============================================================================
FROM quay.io/epheo/kiss:latest
COPY --from=builder /app/_build/html/ /content/