blackbirdchess-docker-dev/caddy/Dockerfile
ahkui 0bbfb2d228 Update caddy Dockerfile (#1788)
* Change base image
2018-09-15 21:22:44 +08:00

28 lines
651 B
Docker

FROM golang:alpine
LABEL maintainer="Huadong Zuo <admin@zuohuadong.cn>"
RUN apk add --no-cache \
openssh \
git \
build-base && \
go get github.com/abiosoft/caddyplug/caddyplug \
&& caddyplug install-caddy \
apk del build-base
ARG plugins="cors"
## ARG plugins="cors cgi cloudflare azure linode"
RUN caddyplug install ${plugins}
RUN apk add --no-cache inotify-tools \
&& echo -e "#!/bin/sh\nwhile inotifywait -e modify /etc/caddy; do\n\tpkill caddy\ndone " >> /start.sh \
&& chmod +x /start.sh
EXPOSE 80 443
WORKDIR /var/www/public
CMD ["sh","-c","/start.sh & /usr/bin/caddy -conf /etc/caddy/Caddyfile -agree"]