2023-05-24 18:08:08 +02:00
|
|
|
FROM cr.simoncor.net/siempie/hugo-sws:latest
|
2023-05-24 10:21:58 +02:00
|
|
|
|
2024-09-06 17:34:27 +02:00
|
|
|
# build cache date argument trick
|
2024-09-06 17:53:06 +02:00
|
|
|
ARG GITEA_SHA=some_sha
|
|
|
|
RUN echo $GITEA_SHA
|
2024-09-06 17:34:27 +02:00
|
|
|
|
2023-05-24 10:21:58 +02:00
|
|
|
# clone site and template
|
2024-10-14 11:03:47 +02:00
|
|
|
COPY . /src
|
2023-05-24 10:21:58 +02:00
|
|
|
|
|
|
|
# generate site
|
|
|
|
RUN set -e \
|
2024-10-14 11:03:47 +02:00
|
|
|
&& /usr/local/bin/hugo --source=/src/
|
|
|
|
|
|
|
|
# copy public content
|
|
|
|
RUN set -e \
|
|
|
|
&& cp -r /src/public /site/
|
|
|
|
|
|
|
|
# cleanup
|
|
|
|
RUN set -e \
|
|
|
|
&& rm -rf /src
|
2023-05-24 10:21:58 +02:00
|
|
|
|
|
|
|
# expose 80
|
|
|
|
EXPOSE 80
|
|
|
|
|
|
|
|
# start static-web-server
|
2024-10-14 11:03:47 +02:00
|
|
|
ENTRYPOINT ["/usr/local/bin/sws", "--host=0.0.0.0", "--log-level=info", "--port=80", "--root=/site/"]
|