namesny-com/Dockerfile

28 lines
867 B
Docker
Raw Permalink Normal View History

2024-02-15 20:59:46 +00:00
FROM golang:1.21-bookworm as build
ARG DART_SASS_VERSION=1.70.0
ARG HUGO_VERSION=0.122.0
2023-02-13 19:05:21 +00:00
WORKDIR /app
2024-02-15 20:59:46 +00:00
# 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
2023-02-13 19:05:21 +00:00
COPY . /app
RUN hugo mod get -u && \
2024-02-15 20:59:46 +00:00
hugo --gc --minify
2023-02-13 19:05:21 +00:00
FROM nginx:stable-alpine
2024-01-05 19:29:25 +00:00
COPY --from=build /app/public /usr/share/nginx/html/
2024-02-15 20:59:46 +00:00
COPY ./nginx.conf /etc/nginx/conf.d/default.conf