feat(7.4-caddy): 更新系统,优化分层
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
李东云
2022-05-10 21:52:45 +08:00
parent 09d33a4d07
commit 5a07601be1

View File

@@ -7,38 +7,34 @@ LABEL version="7.4" \
WORKDIR /srv
# 系统设置(设置时区)
RUN rm -rf /etc/localtime \
&& ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" /etc/timezone
# 添加 Composer
COPY --from=composer /usr/bin/composer /usr/bin/composer
# 国内源
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
# 添加 Caddy
COPY --from=base /usr/bin/caddy /usr/bin/caddy
COPY caddy/Caddyfile /etc/caddy/
COPY --from=base /usr/share/caddy /usr/share/caddy
COPY --from=base /etc/nsswitch.conf /etc/nsswitch.conf
RUN apk add --no-cache ca-certificates mailcap \
&& set -eux \
&& mkdir -p \
/config/caddy \
/data/caddy \
/etc/caddy \
/usr/share/caddy
ADD caddy/startup .
# See https://caddyserver.com/docs/conventions#file-locations for details
ENV XDG_CONFIG_HOME /config
ENV XDG_DATA_HOME /data
# 系统设置(设置时区)
# 国内源 && 系统更新
RUN rm -rf /etc/localtime \
&& ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" /etc/timezone \
&& sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \
&& apk update \
&& apk upgrade \
&& apk add --no-cache ca-certificates mailcap \
&& chmod +x ./startup && pwd && ls -la
EXPOSE 80
# 入口
ADD caddy/startup .
RUN chmod +x ./startup && pwd && ls -la
RUN
ENTRYPOINT ./startup