From b6cc07030c71a129c7754e94b5b52cfe64d0d117 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Tue, 15 May 2018 16:26:43 +0200 Subject: initial commit --- alpine-darkhttpd/Dockerfile | 10 ++++++++++ alpine-mksite/Dockerfile | 31 +++++++++++++++++++++++++++++++ alpine-mksite/update.sh | 22 ++++++++++++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 alpine-darkhttpd/Dockerfile create mode 100644 alpine-mksite/Dockerfile create mode 100755 alpine-mksite/update.sh diff --git a/alpine-darkhttpd/Dockerfile b/alpine-darkhttpd/Dockerfile new file mode 100644 index 0000000..f461934 --- /dev/null +++ b/alpine-darkhttpd/Dockerfile @@ -0,0 +1,10 @@ +FROM alpine:3.7 + +RUN apk add --no-cache darkhttpd +RUN \ + echo "text/plain yaml" >> /etc/mime.types && \ + echo "image/svg+xml svg" >> /etc/mime.types + +VOLUME /www +CMD ["darkhttpd", "/www/htdocs", "--uid", "darkhttpd", "--gid", "www-data", "--log", "/www/log/darkhttpd/access.log"] +EXPOSE 80 diff --git a/alpine-mksite/Dockerfile b/alpine-mksite/Dockerfile new file mode 100644 index 0000000..cafa837 --- /dev/null +++ b/alpine-mksite/Dockerfile @@ -0,0 +1,31 @@ +FROM alpine:3.7 + +ENV LUAVER=5.3 + +RUN addgroup -S -g 82 www-data +RUN adduser -D -S -G www-data wwwbuild +RUN apk add --no-cache \ + git \ + curl \ + lua$LUAVER-discount \ + lua$LUAVER-feedparser \ + lua$LUAVER-filesystem \ + lua$LUAVER-lustache \ + lua$LUAVER-lyaml \ + lua$LUAVER-yaml \ + lua$LUAVER \ + make \ + mqtt-exec \ + rsync + +COPY update.sh /usr/local/bin/update.sh +RUN chmod +x /usr/local/bin/update.sh + +VOLUME /www + +USER wwwbuild +ENTRYPOINT ["/usr/bin/mqtt-exec", "-h", "msg.alpinelinux.org", "--verbose", \ + "--topic", "git/alpine-mksite/#", \ + "--topic", "git/aports/master", \ + "--topic", "rsync/#", \ + "--", "/usr/local/bin/update.sh"] diff --git a/alpine-mksite/update.sh b/alpine-mksite/update.sh new file mode 100755 index 0000000..7047e22 --- /dev/null +++ b/alpine-mksite/update.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +: ${GITBRANCH:=master} +target=all +case "$1" in +git/aports/*) target=update-git-commits;; +git/alpine-mksite/$GITBRANCH) target=all;; +rsync/*) target=update-release;; +esac + +dest=/www/htdocs/ +workdir=/www/tmp/ + +if [ ! -d $workdir/alpine-mksite ]; then + mkdir -p "$workdir" + git clone git://git.alpinelinux.org/alpine-mksite $workdir/alpine-mksite +fi +cd $workdir/alpine-mksite +git checkout "$GITBRANCH" +git pull --force +make $target && rsync -Pruv _out/* $dest + -- cgit v1.2.3