From 2c13d0b177f7aa821e7ef8d0f7f215ee1cefd613 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E9=9B=B7?= <284428564@QQ.com> Date: Mon, 13 May 2024 17:30:27 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TelpoPush.Worker.ThirdSsl/Dockerfile | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/TelpoPush.Worker.ThirdSsl/Dockerfile b/TelpoPush.Worker.ThirdSsl/Dockerfile index 141d4a8..67d5c4e 100644 --- a/TelpoPush.Worker.ThirdSsl/Dockerfile +++ b/TelpoPush.Worker.ThirdSsl/Dockerfile @@ -1,40 +1,38 @@ #See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging. FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS base -USER app WORKDIR /app FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build -ARG BUILD_CONFIGURATION=Release WORKDIR /src COPY ["TelpoPush.Worker.ThirdSsl/TelpoPush.Worker.ThirdSsl.csproj", "TelpoPush.Worker.ThirdSsl/"] COPY ["TelpoPush.Common/TelpoPush.Common.csproj", "TelpoPush.Common/"] COPY ["TelpoPush.Models/TelpoPush.Models.csproj", "TelpoPush.Models/"] COPY ["TelpoPush.Service/TelpoPush.Service.csproj", "TelpoPush.Service/"] +#RUN dotnet nuget remove source nuget.org +##RUN dotnet nuget add source https://mirrors.cloud.tencent.com/nuget/ -n tencent_nuget # ÌÚѶ +#RUN dotnet nuget add source https://repo.huaweicloud.com/repository/nuget/v3/index.json -n huaweicloud_nuget #»ªÎª + COPY ["nuget.config","."] RUN dotnet nuget remove source nuget.org RUN dotnet nuget add source https://repo.huaweicloud.com/repository/nuget/v3/index.json -n huaweicloud_nuget - -RUN dotnet restore "./TelpoPush.Worker.ThirdSsl/TelpoPush.Worker.ThirdSsl.csproj" +RUN dotnet restore "TelpoPush.Worker.ThirdSsl/TelpoPush.Worker.ThirdSsl.csproj" COPY . . WORKDIR "/src/TelpoPush.Worker.ThirdSsl" -RUN dotnet build "./TelpoPush.Worker.ThirdSsl.csproj" -c $BUILD_CONFIGURATION -o /app/build + FROM build AS publish -ARG BUILD_CONFIGURATION=Release -RUN dotnet publish "./TelpoPush.Worker.ThirdSsl.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false +RUN dotnet publish "TelpoPush.Worker.ThirdSsl.csproj" -c Release -o /app/publish + FROM base AS final WORKDIR /app COPY --from=publish /app/publish . COPY pem/app/pem - - ENV environment=Development ENV TimeZone=Asia/Shanghai ENV LANG C.UTF-8 -#RUN ln -snf /usr/share/zoneinfo/$TimeZone /etc/localtime && echo $TimeZone > /etc/timezone - -#ENTRYPOINT ["dotnet", "TelpoPush.Worker.ThirdSsl.dll"] -ENTRYPOINT ["sh", "-c", "dotnet TelpoPush.Worker.ThirdSsl.dll --environment=$environment"] \ No newline at end of file +ENV ASPNETCORE_ENVIRONMENT_LOG=Development +RUN ln -snf /usr/share/zoneinfo/$TimeZone /etc/localtime && echo $TimeZone > /etc/timezone +ENTRYPOINT dotnet TelpoPush.Worker.ThirdSsl.dll --environment=$environment \ No newline at end of file