2022-11-01 13:03:03 +01:00
|
|
|
FROM ubuntu:latest
|
|
|
|
ENV DEBIAN_FRONTEND noninteractive
|
|
|
|
|
2022-11-01 15:27:07 +01:00
|
|
|
# prepare basic stuff
|
2022-11-01 13:03:03 +01:00
|
|
|
RUN set -e && ln -sf bash /bin/sh
|
|
|
|
RUN set -e \
|
|
|
|
&& apt -y update \
|
|
|
|
&& apt -y upgrade \
|
|
|
|
&& apt -y install --no-install-recommends --no-install-suggests ca-certificates git wget \
|
|
|
|
&& apt -y autoremove \
|
|
|
|
&& apt clean \
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
2022-11-01 15:27:07 +01:00
|
|
|
|
|
|
|
# install hugo
|
2022-11-01 13:03:03 +01:00
|
|
|
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
|
|
|
|
|
2022-11-01 15:27:07 +01:00
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
|
|
2022-11-01 18:08:27 +01:00
|
|
|
# clone site and template
|
2022-11-01 13:03:03 +01:00
|
|
|
RUN set -e \
|
2022-11-01 18:08:27 +01:00
|
|
|
&& git clone https://git.simoncor.net/siempie/start.simoncor.net.git /site \
|
|
|
|
&& git clone https://github.com/gesquive/slate /site/themes/slate
|
2022-11-01 15:27:07 +01:00
|
|
|
|
|
|
|
# generate site
|
|
|
|
RUN set -e \
|
2022-11-01 17:26:28 +01:00
|
|
|
&& /usr/local/bin/hugo --source=/site/
|
2022-11-01 15:27:07 +01:00
|
|
|
|
|
|
|
|
|
|
|
# expose 80
|
2022-11-01 14:44:43 +01:00
|
|
|
EXPOSE 80
|
2022-11-01 15:27:07 +01:00
|
|
|
|
|
|
|
|
|
|
|
# start static-web-server
|
2022-11-01 18:08:27 +01:00
|
|
|
ENTRYPOINT ["/usr/local/bin/sws", "--host=0.0.0.0", "--log-level=info", "--port=80", "--root=/site/public/"]
|