2018-09-15 21:22:44 +08:00
|
|
|
FROM golang:alpine
|
2017-11-15 13:00:57 +08:00
|
|
|
|
2018-03-16 17:34:47 +08:00
|
|
|
LABEL maintainer="Huadong Zuo <admin@zuohuadong.cn>"
|
2016-07-20 10:51:20 +08:00
|
|
|
|
2018-09-15 21:22:44 +08:00
|
|
|
RUN apk add --no-cache \
|
|
|
|
openssh \
|
|
|
|
git \
|
|
|
|
build-base && \
|
|
|
|
go get github.com/abiosoft/caddyplug/caddyplug \
|
|
|
|
&& caddyplug install-caddy \
|
|
|
|
apk del build-base
|
|
|
|
|
2017-11-15 13:00:57 +08:00
|
|
|
ARG plugins="cors"
|
2016-08-27 03:01:48 +08:00
|
|
|
|
2017-11-15 13:00:57 +08:00
|
|
|
## ARG plugins="cors cgi cloudflare azure linode"
|
2016-07-20 10:51:20 +08:00
|
|
|
|
2017-11-15 13:00:57 +08:00
|
|
|
RUN caddyplug install ${plugins}
|
2018-08-26 16:02:55 +08:00
|
|
|
|
|
|
|
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
|
2016-07-20 10:51:20 +08:00
|
|
|
|
2018-09-15 21:22:44 +08:00
|
|
|
EXPOSE 80 443
|
2016-07-25 12:31:31 +08:00
|
|
|
|
2017-05-01 18:36:31 +08:00
|
|
|
WORKDIR /var/www/public
|
2016-07-20 10:51:20 +08:00
|
|
|
|
2018-08-26 16:02:55 +08:00
|
|
|
CMD ["sh","-c","/start.sh & /usr/bin/caddy -conf /etc/caddy/Caddyfile -agree"]
|