fix: 统一前端Harbor镜像发布与拉取部署

This commit is contained in:
Yvan
2026-11-05 13:08:56 +08:00
parent 5f6e893457
commit af2a2a44b3
13 changed files with 201 additions and 61 deletions
+3 -2
View File
@@ -1,6 +1,6 @@
# 与服务器 deploy.sh 对齐:
# docker build --build-arg VERSION=$TAG -t sw2/frontend:$TAG .
# docker run --rm --add-host sw2-backend:127.0.0.1 sw2/frontend:$TAG nginx -t
# docker build --build-arg VERSION=$TAG -t harbor.fuhua91.com/game/sw2:$TAG .
# docker push harbor.fuhua91.com/game/sw2:$TAG
# 运行阶段与部署侧 frontend.Dockerfile 一致。本仓库在镜像内编译,
# 产物对应部署侧的 COPY dist/。
@@ -19,5 +19,6 @@ ARG VERSION
LABEL org.opencontainers.image.revision=$VERSION
COPY nginx.sw2.conf /etc/nginx/conf.d/default.conf
COPY --from=build /src/dist /usr/share/nginx/html/
RUN printf '%s\n' "$VERSION" > /usr/share/nginx/html/version.txt
HEALTHCHECK --interval=15s --timeout=5s --start-period=10s --retries=3 \
CMD wget -q -O /dev/null http://127.0.0.1/healthz || exit 1