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
This commit is contained in:
+9
-14
@@ -1,25 +1,20 @@
|
||||
# ── Stage 1: builder ────────────────────────────────────────────────────────
|
||||
FROM node:22-alpine AS builder
|
||||
|
||||
# Install Hugo extended + build tools
|
||||
RUN apk add --no-cache \
|
||||
curl \
|
||||
git \
|
||||
libc6-compat \
|
||||
&& HUGO_VERSION=0.147.2 \
|
||||
&& curl -sSL "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz" \
|
||||
| tar -xz -C /usr/local/bin hugo
|
||||
# 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 corepack enable && corepack prepare pnpm@latest --activate
|
||||
RUN npm install -g pnpm
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install dependencies
|
||||
COPY package.json pnpm-lock.yaml* ./
|
||||
# Copy package files first (for layer caching)
|
||||
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
|
||||
RUN pnpm install --frozen-lockfile
|
||||
|
||||
# Copy source
|
||||
# Copy source files
|
||||
COPY . .
|
||||
|
||||
# Build site
|
||||
|
||||
@@ -36,6 +36,9 @@ noClasses = true
|
||||
[build]
|
||||
writeStats = true
|
||||
|
||||
[security.exec]
|
||||
allow = ['^(dart-)?sass$', '^go$', '^git$', '^node$', '^npx$', '^tailwindcss$']
|
||||
|
||||
[[menus.footer]]
|
||||
name = "Imprint"
|
||||
url = "/imprint/"
|
||||
|
||||
@@ -90,8 +90,8 @@
|
||||
/>
|
||||
</noscript>
|
||||
|
||||
<!-- CSS via Hugo Pipes + PostCSS + Tailwind v4 -->
|
||||
{{- $css := resources.Get "css/main.css" | css.PostCSS -}}
|
||||
<!-- CSS via Hugo Pipes + Tailwind v4 (native css.TailwindCSS, no PostCSS) -->
|
||||
{{- $css := resources.Get "css/main.css" | css.TailwindCSS -}}
|
||||
{{- if eq hugo.Environment "production" -}}
|
||||
{{- $css = $css | minify | fingerprint "sha256" -}}
|
||||
{{- end -}}
|
||||
|
||||
+1
-4
@@ -11,10 +11,7 @@
|
||||
"format:check": "prettier --check \"layouts/**/*.html\" \"assets/**/*.css\" \"assets/**/*.js\" \"content/**/*.md\" \"*.toml\""
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tailwindcss/postcss": "^4.0.0",
|
||||
"autoprefixer": "^10.4.0",
|
||||
"postcss": "^8.5.0",
|
||||
"postcss-cli": "^11.0.0",
|
||||
"@tailwindcss/cli": "^4.0.0",
|
||||
"prettier": "^3.8.3",
|
||||
"prettier-plugin-go-template": "^0.0.15",
|
||||
"prettier-plugin-toml": "^2.0.6",
|
||||
|
||||
Generated
+255
-521
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,3 @@
|
||||
preferSymlinkedExecutables: true
|
||||
allowBuilds:
|
||||
'@parcel/watcher': true
|
||||
@@ -1,6 +0,0 @@
|
||||
module.exports = {
|
||||
plugins: {
|
||||
"@tailwindcss/postcss": {},
|
||||
autoprefixer: {},
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user