|
- #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/"]
-
- 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"
- 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
-
- 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"]
|