|
123456789101112131415161718192021222324252627282930313233343536373839 |
- #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
- WORKDIR /app
-
- FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
- 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"
- COPY . .
- WORKDIR "/src/TelpoPush.Worker.ThirdSsl"
-
-
- FROM build AS publish
- 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
- RUN apk add --no-cache tzdata
- ENV TimeZone=Asia/Shanghai
- ENV LANG C.UTF-8
- 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
|