aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2018-05-15 16:26:43 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2018-05-15 16:30:33 +0200
commitb6cc07030c71a129c7754e94b5b52cfe64d0d117 (patch)
tree41126072538e33134e94a65469ae5cd92d097472
downloadalpine-infra-docker-b6cc07030c71a129c7754e94b5b52cfe64d0d117.tar.bz2
alpine-infra-docker-b6cc07030c71a129c7754e94b5b52cfe64d0d117.tar.xz
initial commit
-rw-r--r--alpine-darkhttpd/Dockerfile10
-rw-r--r--alpine-mksite/Dockerfile31
-rwxr-xr-xalpine-mksite/update.sh22
3 files changed, 63 insertions, 0 deletions
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
+