Auto reload caddy and add basicauth example (#1706)
* add live reload and basicauth
This commit is contained in:
parent
aa84dd8616
commit
947a791ad2
@ -6,12 +6,14 @@ 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 2015
|
||||
|
||||
WORKDIR /var/www/public
|
||||
|
||||
CMD ["/usr/bin/caddy", "-conf", "/etc/Caddyfile","-agree"]
|
||||
CMD ["sh","-c","/start.sh & /usr/bin/caddy -conf /etc/caddy/Caddyfile -agree"]
|
||||
|
@ -44,3 +44,8 @@ laradock2.demo:80 {
|
||||
#proxy domain.com
|
||||
#cors
|
||||
}
|
||||
|
||||
laradock3.demo:80 {
|
||||
import authlist.conf
|
||||
root /var/www/public
|
||||
}
|
1
caddy/caddy/authlist.conf
Normal file
1
caddy/caddy/authlist.conf
Normal file
@ -0,0 +1 @@
|
||||
basicauth / laradock laradock
|
@ -471,7 +471,7 @@ services:
|
||||
build: ./caddy
|
||||
volumes:
|
||||
- ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}
|
||||
- ${CADDY_CUSTOM_CADDYFILE}:/etc/Caddyfile
|
||||
- ${CADDY_CONFIG_PATH}:/etc/caddy
|
||||
- ${CADDY_HOST_LOG_PATH}:/var/log/caddy
|
||||
- ${DATA_PATH_HOST}:/root/.caddy
|
||||
ports:
|
||||
|
@ -355,7 +355,7 @@ MONGODB_PORT=27017
|
||||
CADDY_HOST_HTTP_PORT=80
|
||||
CADDY_HOST_HTTPS_PORT=443
|
||||
CADDY_HOST_LOG_PATH=./logs/caddy
|
||||
CADDY_CUSTOM_CADDYFILE=./caddy/Caddyfile
|
||||
CADDY_CONFIG_PATH=./caddy/caddy
|
||||
|
||||
### LARAVEL ECHO SERVER ###################################
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user