Skip to content

Instantly share code, notes, and snippets.

@kevinsimper
Created June 19, 2017 17:51
Show Gist options
  • Select an option

  • Save kevinsimper/c22285980d27cb46e1aa6af35841d550 to your computer and use it in GitHub Desktop.

Select an option

Save kevinsimper/c22285980d27cb46e1aa6af35841d550 to your computer and use it in GitHub Desktop.
Caddyserver
FROM alpine:latest
LABEL caddy_version="dev" architecture="amd64"
ENV GOPATH="/go"
EXPOSE 80 443 2015
ENTRYPOINT [ "/usr/bin/caddy" ]
WORKDIR /srv
RUN apk -U --no-progress upgrade \
&& apk -U --force --no-progress add \
build-tools go git ca-certificates musl-dev \
&& git config --global http.https://gopkg.in.followRedirects true \
&& mkdir /go \
&& go get github.com/mholt/caddy/caddy \
&& mv /go/bin/caddy /usr/bin \
&& apk del --purge build-tools go git \
&& rm -rf $GOPATH /var/cache/apk/*
COPY ./Caddyfile /etc/Caddyfile
VOLUME [ "/root/.caddy" ]
CMD ["--conf", "/etc/Caddyfile", "--log", "stdout"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment