Skip to content

Instantly share code, notes, and snippets.

@wader
Last active July 31, 2018 14:28
Show Gist options
  • Save wader/669fecab510d6a4f35b8197e7bb4d7f1 to your computer and use it in GitHub Desktop.
Save wader/669fecab510d6a4f35b8197e7bb4d7f1 to your computer and use it in GitHub Desktop.
Caddy docker image
:8080/web_path/ {
#tls off
root /some/local/path
browse /
}
FROM golang:1.10 as builder
ENV PLUGINS \
github.com/hacdias/caddy-webdav
RUN go get github.com/mholt/caddy/caddy $PLUGINS
RUN echo \
'package caddymain\n' \
'import (\n' \
$(for p in $PLUGINS; do echo "_ \"$p\"\\\n"; done) \
')\n' \
> /go/src/github.com/mholt/caddy/caddy/caddymain/plugins.go
RUN go install -installsuffix netgo -tags netgo github.com/mholt/caddy/caddy
FROM scratch
COPY --from=builder /go/bin/caddy /
EXPOSE 80/tcp 443/tcp
WORKDIR /
ENTRYPOINT ["/caddy"]
CMD ["--conf", "/Caddyfile", "--log", "stdout"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment