2025-07-10 14:28:45 +08:00
|
|
|
FROM --platform=$TARGETPLATFORM nginx:alpine
|
2025-07-05 01:13:28 +08:00
|
|
|
|
2025-03-17 21:27:48 +08:00
|
|
|
# 系统时区
|
|
|
|
|
ARG TZ=Asia/Shanghai
|
2025-07-05 01:13:28 +08:00
|
|
|
|
|
|
|
|
# 添加包 & 设置时区
|
2025-03-17 21:27:48 +08:00
|
|
|
RUN \
|
|
|
|
|
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
|
|
|
|
|
apk update && \
|
2025-07-05 01:13:28 +08:00
|
|
|
apk add --no-cache tzdata && \
|
|
|
|
|
ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime && \
|
|
|
|
|
echo "${TZ}" > /etc/timezone && \
|
|
|
|
|
rm -rf /var/cache/apk/* && \
|
2025-09-25 00:51:44 +08:00
|
|
|
rm -rf /etc/nginx/nginx.conf && \
|
2025-07-05 01:13:28 +08:00
|
|
|
rm -rf /etc/nginx/conf.d/*
|
|
|
|
|
|
2025-09-25 00:51:44 +08:00
|
|
|
# 复制前端静态文件
|
2025-07-05 17:44:33 +08:00
|
|
|
COPY ./ui/dist /usr/share/nginx/html
|
2025-07-05 01:13:28 +08:00
|
|
|
|
|
|
|
|
# 复制配置
|
2025-09-25 00:51:44 +08:00
|
|
|
COPY ./ui/nginx.conf /etc/nginx
|
|
|
|
|
COPY ./ui/service.conf /etc/nginx/conf.d
|
|
|
|
|
|
|
|
|
|
# 复制启动脚本
|
|
|
|
|
COPY ./ui/entrypoint.sh /entrypoint.sh
|
|
|
|
|
RUN chmod +x /entrypoint.sh
|
2025-07-05 01:13:28 +08:00
|
|
|
|
2025-03-17 21:27:48 +08:00
|
|
|
# 启动
|
2025-09-25 00:51:44 +08:00
|
|
|
ENTRYPOINT ["/entrypoint.sh"]
|
2025-07-05 01:13:28 +08:00
|
|
|
CMD ["nginx", "-g", "daemon off;"]
|