From 0a82545dd5f4116c90228aa5e46a8dd061db61c5 Mon Sep 17 00:00:00 2001 From: Simon Cornet Date: Tue, 1 Nov 2022 15:27:07 +0100 Subject: [PATCH] [Global] Use sws instead of hugo server --- Dockerfile.linux.amd64 | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/Dockerfile.linux.amd64 b/Dockerfile.linux.amd64 index ca6fbfd..93deba1 100644 --- a/Dockerfile.linux.amd64 +++ b/Dockerfile.linux.amd64 @@ -1,6 +1,7 @@ FROM ubuntu:latest ENV DEBIAN_FRONTEND noninteractive +# prepare basic stuff RUN set -e && ln -sf bash /bin/sh RUN set -e \ && apt -y update \ @@ -10,14 +11,37 @@ RUN set -e \ && apt clean \ && rm -rf /var/lib/apt/lists/* + +# install hugo RUN set -e \ && wget -q -O /tmp/hugo.deb https://github.com/gohugoio/hugo/releases/download/v0.105.0/hugo_0.105.0_linux-amd64.deb \ && apt -y install /tmp/hugo.deb \ && rm -f /tmp/hugo.deb + +# install static-web-server +RUN set -e \ + && wget -q -O /tmp/sws.tar.gz https://github.com/static-web-server/static-web-server/releases/download/v2.13.1/static-web-server-v2.13.1-x86_64-unknown-linux-gnu.tar.gz \ + && tar -zxf /tmp/sws.tar.gz \ + && mv static-web-server-v2.13.1-x86_64-unknown-linux-gnu/static-web-server /usr/local/bin/sws \ + && rm -rf static-web-server-v* \ + && rm -f /tmp/sws.tar.gz + + +# clone site RUN set -e \ && git clone https://git.simoncor.net/siempie/start.simoncor.net.git /site/ + +# generate site +RUN set -e \ + $$ /usr/local/bin/hugo --source=/site/ + + +# expose 80 EXPOSE 80 -ENTRYPOINT ["/usr/local/bin/hugo", "server"] -CMD ["--appendPort=false", "--baseUrl=https://start.simoncor.net", "--bind=0.0.0.0", "--port=80", "--source=/site/", "--theme=slate"] + + +# start static-web-server +ENTRYPOINT ["/usr/local/bin/sws"] +CMD ["-d /site/public/", "-p 80"]