Skip to content

Commit

Permalink
Rewrite Dockerfile to build hugo staticly
Browse files Browse the repository at this point in the history
  • Loading branch information
Siarl committed Feb 24, 2024
1 parent 0c684e6 commit 25de01e
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@


FROM alpine:latest
FROM alpine:latest AS build

ARG HUGO_VERSION=0.68.3

Expand All @@ -15,8 +14,13 @@ RUN wget https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hug
WORKDIR /usr/src/app
COPY . .
RUN git submodule init && git submodule update --remote --merge
RUN mkdir -m 777 /usr/src/app/resources
RUN /opt/hugo

FROM nginx:mainline

WORKDIR /usr/share/nginx/html

COPY --from=build /usr/src/app/public .

EXPOSE 1313
CMD [ "/opt/hugo", "server", "--bind=0.0.0.0" ]
EXPOSE 80

0 comments on commit 25de01e

Please sign in to comment.