File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed
Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ ARG BASE_URL
2+
3+ FROM ubuntu:24.04 AS base
4+ RUN apt-get update && apt-get install -y curl git
5+
6+ FROM node:20-bullseye AS node
7+ WORKDIR /app
8+ COPY package.json yarn.lock ./
9+ RUN yarn install --frozen-lockfile
10+
11+ FROM base AS sass
12+ ARG SASS_VERSION=1.93.1
13+ RUN curl -L -o /tmp/dart-sass.tar.gz https://github.com/sass/dart-sass/releases/download/1.93.1/dart-sass-1.93.1-linux-x64.tar.gz && \
14+ mkdir -p /mnt/dart-sass && \
15+ tar --extract --directory /mnt/dart-sass --file /tmp/dart-sass.tar.gz --strip 2
16+ COPY <<"EOF" /usr/bin/sass
17+ # !/bin/sh
18+ exec "/usr/share/dart-sass/dart" "/usr/share/dart-sass/sass.snapshot" "$@"
19+ EOF
20+ RUN chmod +x /usr/bin/sass && \
21+ mkdir -p /usr/share/dart-sass && \
22+ cp /mnt/dart-sass/dart /usr/share/dart-sass/dart && \
23+ cp /mnt/dart-sass/sass.snapshot /usr/share/dart-sass/sass.snapshot
24+
25+ FROM base AS builder
26+ ARG HUGO_VERSION=0.118.2
27+ RUN curl -L -o /tmp/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
28+ && dpkg -i /tmp/hugo.deb
29+ COPY --from=sass /usr/bin/sass /usr/bin/sass
30+ COPY --from=sass /usr/share/dart-sass /usr/share/dart-sass
31+
32+ FROM builder AS hugo
33+ WORKDIR /app
34+ COPY . .
35+ COPY --from=node /app/node_modules ./node_modules
36+ ENV HUGO_ENVIRONMENT=production
37+ ENV HUGO_ENV=production
38+ ARG BASE_URL
39+ RUN hugo --gc --minify --baseURL="$BASE_URL"
40+ RUN ls -lha .
41+
42+ FROM scratch
43+ COPY --from=hugo /app/public .
You can’t perform that action at this time.
0 commit comments