From c59c28618c1eefaffc02f4f73c10a6b2c6c050c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?old=E6=98=93?= <156663459@qq.com> Date: Tue, 11 Mar 2025 15:06:58 +0800 Subject: [PATCH] bug fixed --- New_College.Api/Dockerfile | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/New_College.Api/Dockerfile b/New_College.Api/Dockerfile index 2aa9f96..01e616e 100644 --- a/New_College.Api/Dockerfile +++ b/New_College.Api/Dockerfile @@ -1,7 +1,12 @@ +# 使用 SDK 镜像作为构建基础 FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build -RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime -RUN echo 'Asia/Shanghai' >/etc/timezone +ENV TZ=Asia/Shanghai +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone +# 设置工作目录 WORKDIR /app -COPY --from=build /app ./ + +# 暴露应用端口 EXPOSE 8081 +COPY . . +# 设置容器启动命令 ENTRYPOINT ["dotnet", "New_College.Api.dll","-b","0.0.0.0"]