Permalink
Fetching contributors…
Cannot retrieve contributors at this time
48 lines (33 sloc) 949 Bytes
#
# Builder
#
FROM abiosoft/caddy:builder as builder
ARG version="0.11.0"
ARG plugins="git,filemanager,cors,realip,expires,cache"
# process wrapper
RUN go get -v github.com/abiosoft/parent
RUN VERSION=${version} PLUGINS=${plugins} /bin/sh /usr/bin/builder.sh
#
# Final stage
#
FROM alpine:3.8
LABEL maintainer "Abiola Ibrahim <abiola89@gmail.com>"
ARG version="0.11.0"
LABEL caddy_version="$version"
# Let's Encrypt Agreement
ENV ACME_AGREE="false"
RUN apk add --no-cache openssh-client git
# install caddy
COPY --from=builder /install/caddy /usr/bin/caddy
# validate install
RUN /usr/bin/caddy -version
RUN /usr/bin/caddy -plugins
EXPOSE 80 443 2015
VOLUME /root/.caddy /srv
WORKDIR /srv
COPY Caddyfile /etc/Caddyfile
COPY index.html /srv/index.html
# install process wrapper
COPY --from=builder /go/bin/parent /bin/parent
ENTRYPOINT ["/bin/parent", "caddy"]
CMD ["--conf", "/etc/Caddyfile", "--log", "stdout", "--agree=$ACME_AGREE"]