From f75b06a1f73a21e1426fcf8446e70797a4f1b266 Mon Sep 17 00:00:00 2001 From: Simon Cornet Date: Mon, 14 Oct 2024 11:08:23 +0200 Subject: [PATCH] [hugo] feat: use copy instead of git clone where possible --- Dockerfile.linux.amd64 | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/Dockerfile.linux.amd64 b/Dockerfile.linux.amd64 index f55168f..f73c4c4 100644 --- a/Dockerfile.linux.amd64 +++ b/Dockerfile.linux.amd64 @@ -4,17 +4,27 @@ FROM cr.simoncor.net/siempie/hugo-sws:latest ARG GITEA_SHA=some_sha RUN echo $GITEA_SHA -# clone site and template +# copy site +COPY . /src + +# clone template RUN set -e \ - && git clone https://git.simoncor.net/siempie/start.simoncor.net.git /site \ - && git clone https://github.com/gesquive/slate /site/themes/slate + && git clone https://github.com/gesquive/slate /src/themes/slate # generate site RUN set -e \ - && /usr/local/bin/hugo --source=/site/ + && /usr/local/bin/hugo --source=/src/ + +# copy public content +RUN set -e \ + && cp -r /src/public /site/ + +# cleanup +RUN set -e \ + && rm -rf /src # expose 80 EXPOSE 80 # start static-web-server -ENTRYPOINT ["/usr/local/bin/sws", "--host=0.0.0.0", "--log-level=info", "--port=80", "--root=/site/public/"] +ENTRYPOINT ["/usr/local/bin/sws", "--host=0.0.0.0", "--log-level=info", "--port=80", "--root=/site/"]