2026-08-29 21:11:24 +02:00
|
|
|
### Stage 1: Build the site with Hugo Extended + Node (Tailwind runs inside Hugo)
|
|
|
|
|
FROM hugomods/hugo:debian-node-0.165.0 AS hugo
|
2026-05-18 16:27:47 +02:00
|
|
|
WORKDIR /site
|
|
|
|
|
|
2026-08-29 21:11:24 +02:00
|
|
|
# Install JS deps first so this layer caches independently of content changes.
|
|
|
|
|
# Hugo's css.TailwindCSS execs node_modules/.bin/tailwindcss during the build;
|
|
|
|
|
# pnpm-workspace.yaml sets preferSymlinkedExecutables so that shim is a symlink
|
|
|
|
|
# Hugo accepts.
|
|
|
|
|
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
|
|
|
|
|
RUN npm install -g pnpm && pnpm install --frozen-lockfile
|
2026-05-18 16:27:47 +02:00
|
|
|
|
2026-08-29 21:11:24 +02:00
|
|
|
COPY . .
|
|
|
|
|
RUN hugo --minify --gc --environment production
|
|
|
|
|
|
|
|
|
|
### Stage 2: Serve with nginx
|
2026-05-18 16:27:47 +02:00
|
|
|
FROM nginx:1.27-alpine
|
|
|
|
|
COPY --from=hugo /site/public /usr/share/nginx/html
|
|
|
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
|
EXPOSE 80
|