diff --git a/Dockerfile b/Dockerfile index 8a3a73c..9d17c20 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,27 @@ -FROM golang:1.21 as build +FROM golang:1.21-bookworm as build + +ARG DART_SASS_VERSION=1.70.0 +ARG HUGO_VERSION=0.122.0 WORKDIR /app -RUN go install -tags extended github.com/gohugoio/hugo@latest + # Install Dart Sass +RUN curl -LJO https://github.com/sass/dart-sass/releases/download/${DART_SASS_VERSION}/dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz && \ + tar -xf dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz && \ + cp -r dart-sass/* /usr/local/bin && \ + rm -rf dart-sass* + + # Install Hugo +RUN curl -LJO https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb && \ + apt install -y ./hugo_extended_${HUGO_VERSION}_linux-amd64.deb && \ + rm hugo_extended_${HUGO_VERSION}_linux-amd64.deb + COPY . /app RUN hugo mod get -u && \ - hugo + hugo --gc --minify FROM nginx:stable-alpine COPY --from=build /app/public /usr/share/nginx/html/ -COPY ./nginx.conf /etc/nginx/conf.d/default.conf \ No newline at end of file +COPY ./nginx.conf /etc/nginx/conf.d/default.conf