Files
bar/Dockerfile
valknarandClaude Sonnet 5 3166caf6a1 build: switch to native Hugo TailwindCSS pipeline, align Dockerfile with pivoine.art
Replaces the PostCSS + autoprefixer toolchain with Hugo's native
css.TailwindCSS pipe (via @tailwindcss/cli), matching the setup already
in use on pivoine.art. Dockerfile now builds on hugomods/hugo with a
matched Hugo/Node version instead of manually installing Hugo onto
node:22-alpine.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S3xLyuoN6uzfCYBo8kVoSn
2026-09-13 21:29:52 +02:00

31 lines
1.2 KiB
Docker

# ── Stage 1: builder ────────────────────────────────────────────────────────
# 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 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 . .
# Build site
RUN NODE_ENV=production hugo --minify
# ── Stage 2: production (nginx) ──────────────────────────────────────────────
FROM nginx:alpine AS production
COPY --from=builder /app/public /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]