25 lines
747 B
Docker
25 lines
747 B
Docker
|
|
### Stage 1: Build CSS with Tailwind v4
|
||
|
|
FROM node:20-alpine AS tailwind
|
||
|
|
WORKDIR /build
|
||
|
|
COPY package.json pnpm-lock.yaml* ./
|
||
|
|
RUN npm install -g pnpm && pnpm install --frozen-lockfile
|
||
|
|
COPY assets/css ./assets/css
|
||
|
|
COPY layouts ./layouts
|
||
|
|
RUN pnpm build:css
|
||
|
|
|
||
|
|
### Stage 2: Build site with Hugo Extended
|
||
|
|
FROM hugomods/hugo:exts-0.154.3 AS hugo
|
||
|
|
WORKDIR /site
|
||
|
|
|
||
|
|
# Copy everything EXCEPT node_modules
|
||
|
|
COPY . .
|
||
|
|
COPY --from=tailwind /build/static/css/main.css static/css/main.css
|
||
|
|
# Content images are baked in via the import script; make sure they exist
|
||
|
|
RUN hugo --minify --environment production
|
||
|
|
|
||
|
|
### Stage 3: Serve with nginx
|
||
|
|
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
|