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