commit 426d7ada0772558f30ea481aef6772b6f190a47d Author: Jonas Tobias Hopusch Date: Sun Dec 5 16:45:50 2021 +0100 Initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b740c7c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +archive-token.txt diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b4fe12e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM caddy:2 +ARG WEBSITE_ARCHIVE_URL +ARG WEBSITE_ARCHIVE_FOLDER + +RUN apk update && apk upgrade && set -eu + +RUN apk add zola --repository http://dl-cdn.alpinelinux.org/alpine/edge/community/ && apk add tar gzip curl + +COPY archive-token.txt /archive-token.txt +RUN curl -X "GET" -H "Authorization: token $(cat /archive-token.txt)" "$WEBSITE_ARCHIVE_URL" 2>/dev/null | gzip --decompress --stdout - | tar xf - ; rm /archive-token.txt + +WORKDIR /srv/$WEBSITE_ARCHIVE_FOLDER +RUN zola build + +EXPOSE 80/tcp + +CMD ["caddy", "file-server", "--root", "public"] diff --git a/build-kanzleiseite.sh b/build-kanzleiseite.sh new file mode 100755 index 0000000..ec8678b --- /dev/null +++ b/build-kanzleiseite.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +docker build --no-cache --pull -t jotoho/www.hopusch.de:latest \ + --build-arg WEBSITE_ARCHIVE_URL="https://gitea.jotoho.de/api/v1/repos/jotoho/kanzleiseite/archive/master.tar.gz" \ + --build-arg WEBSITE_ARCHIVE_FOLDER="kanzleiseite" \ + . diff --git a/build-personalsite.sh b/build-personalsite.sh new file mode 100755 index 0000000..0e6efd0 --- /dev/null +++ b/build-personalsite.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +docker build --no-cache --pull -t jotoho/www.jotoho.de:latest \ + --build-arg WEBSITE_ARCHIVE_URL="https://gitea.jotoho.de/api/v1/repos/jotoho/my-website/archive/master.tar.gz" \ + --build-arg WEBSITE_ARCHIVE_FOLDER="my-website" \ + .