From 426d7ada0772558f30ea481aef6772b6f190a47d Mon Sep 17 00:00:00 2001 From: Jonas Tobias Hopusch Date: Sun, 5 Dec 2021 16:45:50 +0100 Subject: [PATCH] Initial commit --- .gitignore | 1 + Dockerfile | 17 +++++++++++++++++ build-kanzleiseite.sh | 6 ++++++ build-personalsite.sh | 6 ++++++ 4 files changed, 30 insertions(+) create mode 100644 .gitignore create mode 100644 Dockerfile create mode 100755 build-kanzleiseite.sh create mode 100755 build-personalsite.sh 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" \ + .