diff --git a/docker/frontend/Dockerfile b/docker/frontend/Dockerfile index 37d6c53a..50af19bf 100644 --- a/docker/frontend/Dockerfile +++ b/docker/frontend/Dockerfile @@ -27,7 +27,9 @@ COPY frontend/ ./ # 设置环境变量(构建时使用) ARG NEXT_PUBLIC_API_URL +ARG IMAGE_TAG=unknown ENV NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL} +ENV NEXT_PUBLIC_VERSION=${IMAGE_TAG} # Docker 内部网络使用服务名 server 作为后端地址 ENV API_HOST=server diff --git a/frontend/app/login/page.tsx b/frontend/app/login/page.tsx index f94045ac..6beb90b5 100644 --- a/frontend/app/login/page.tsx +++ b/frontend/app/login/page.tsx @@ -126,6 +126,10 @@ export default function LoginPage() { + {/* 版本号 */} +
+ {process.env.NEXT_PUBLIC_VERSION || 'dev'} +