Skip to content

Instantly share code, notes, and snippets.

@Zenithar
Last active July 21, 2019 21:06
Show Gist options
  • Save Zenithar/d929a44e68ef8a5a85a6 to your computer and use it in GitHub Desktop.
Save Zenithar/d929a44e68ef8a5a85a6 to your computer and use it in GitHub Desktop.
Hugo + Caddy + Webhook
0.0.0.0:2015
root blog.zenithar.org/public
ext .html
gzip
git github.com/zenithar/zenithar.hugo {
path ../
hook /_admin/github/hook/zenithar.org secret
then hugo
}
log stdout
errors {
log stderr
404 404.html
}
FROM sdurrheimer/alpine-glibc:latest
MAINTAINER Thibault NORMAND <me@zenithar.org>
RUN apk --update add git ca-certificates curl \
&& rm -rf /var/cache/apk/*
RUN echo "Installing Caddy..." \
&& curl -jksSL "https://caddyserver.com/download/build?os=linux&arch=amd64&features=git" | gunzip -c - | tar -xf - -C /tmp \
&& mv /tmp/caddy /usr/local/bin/caddy \
&& rm -f /tmp/*.txt
ENV HUGO_VERSION 0.15
RUN echo "Installing Hugo ..." \
&& curl -jksSL "https://github.com/spf13/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_linux_amd64.tar.gz" | gunzip -c - | tar -xf - -C /tmp \
&& mv /tmp/hugo_${HUGO_VERSION}_linux_amd64/hugo_${HUGO_VERSION}_linux_amd64 /usr/local/bin/hugo \
&& rm -rf /tmp/hugo_${HUGO_VERSION}_linux_amd64
RUN adduser -D -u 500 www \
&& mkdir -p /var/www \
&& chown -R www /var/www
WORKDIR /var/www
EXPOSE 2015
USER www
CMD [ "caddy" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment