Files
valknarandClaude Sonnet 5 71828c2379 fix: build CSS with Hugo's native TailwindCSS instead of PostCSS
hugo server/build was failing with "binary postcss is not a Node.js
script" — pnpm's default node_modules/.bin shims are shell wrappers, not
plain Node scripts, which Hugo's exec-security check rejects. Switches
head.html from css.PostCSS to css.TailwindCSS, drops the now-unused
PostCSS toolchain, and adds pnpm-workspace.yaml's
preferSymlinkedExecutables so pnpm emits real symlinks Hugo can exec
(same fix already in use on roux).

Also updates the Dockerfile's build stage to hugomods/hugo:debian-node,
which bundles the matching Hugo Extended + Node versions, keeping ffmpeg
for the video-compression step.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012E2mmywuZyXmPBgSDtNdTL
2026-09-13 17:50:28 +02:00

40 lines
1.1 KiB
Docker

# Stage 1: Build
# hugomods image bundles Hugo Extended + Node at matching, tested versions —
# Hugo's css.TailwindCSS execs node_modules/.bin/tailwindcss during the build,
# and pnpm-workspace.yaml's preferSymlinkedExecutables makes that a plain
# symlink Hugo's exec-security check accepts (see layouts/partials/head.html).
FROM hugomods/hugo:debian-node-0.165.0 AS builder
# Install FFmpeg (video compression)
RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg && rm -rf /var/lib/apt/lists/*
# Install pnpm
RUN npm install -g pnpm
WORKDIR /app
# Copy package files first (for layer caching)
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
RUN pnpm install --frozen-lockfile
# Copy source files
COPY . .
# Compress MP4 videos in-place before Hugo builds
RUN sh scripts/compress-videos.sh content
# Build CSS and Hugo site
RUN pnpm build
# Stage 2: Production
FROM nginx:alpine
# Copy built site
COPY --from=builder /app/public /usr/share/nginx/html
# Copy nginx config
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]