namesny-com/Dockerfile

28 lines
867 B
Docker

FROM golang:1.21-bookworm as build
ARG DART_SASS_VERSION=1.70.0
ARG HUGO_VERSION=0.122.0
WORKDIR /app
# 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 --gc --minify
FROM nginx:stable-alpine
COPY --from=build /app/public /usr/share/nginx/html/
COPY ./nginx.conf /etc/nginx/conf.d/default.conf