This commit is contained in:
16
caddy/7.4/Caddyfile
Normal file
16
caddy/7.4/Caddyfile
Normal file
@@ -0,0 +1,16 @@
|
||||
localhost
|
||||
root * /app/public
|
||||
|
||||
# https://caddyserver.com/docs/caddyfile/directives/php_fastcgi
|
||||
php_fastcgi localhost:9000 {
|
||||
try_files {path} {path}/index.php =404
|
||||
}
|
||||
|
||||
file_server
|
||||
|
||||
handle_errors {
|
||||
root * /etc/caddy/error
|
||||
rewrite * /error.html
|
||||
templates
|
||||
file_server
|
||||
}
|
||||
36
caddy/7.4/Dockerfile
Normal file
36
caddy/7.4/Dockerfile
Normal file
@@ -0,0 +1,36 @@
|
||||
FROM php:7-fpm-alpine
|
||||
|
||||
LABEL version="7.4" \
|
||||
description="php-fpm7.4 alpine" \
|
||||
maintainer="ch4o5<li_dongyun@outlook.com>"
|
||||
|
||||
# 系统设置(设置时区)
|
||||
RUN rm -rf /etc/localtime \
|
||||
&& ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
|
||||
&& echo "Asia/Shanghai" /etc/timezone
|
||||
|
||||
# 国内源
|
||||
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \
|
||||
&& RUN apk add --no-cache ca-certificates mailcap \
|
||||
&& set -eux; \
|
||||
&& mkdir -p \
|
||||
/config/caddy \
|
||||
/data/caddy \
|
||||
/etc/caddy \
|
||||
/usr/share/caddy
|
||||
|
||||
# 添加 Caddy
|
||||
COPY --from=caddy /usr/bin/caddy /usr/bin/caddy
|
||||
COPY Caddyfile /etc/caddy/
|
||||
COPY --from=caddy /usr/share/caddy /usr/share/caddy
|
||||
COPY --from=caddy /etc/nsswitch.conf /etc/nsswitch.conf
|
||||
|
||||
|
||||
# See https://caddyserver.com/docs/conventions#file-locations for details
|
||||
ENV XDG_CONFIG_HOME /config
|
||||
ENV XDG_DATA_HOME /data
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
# 入口
|
||||
CMD ["caddy", "run", "--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"]
|
||||
Reference in New Issue
Block a user