You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.6KB

  1. #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.
  2. FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS base
  3. WORKDIR /app
  4. FROM mcr.microsoft.com/dotnet/sdk:8.0-alpine AS build
  5. WORKDIR /src
  6. COPY ["TelpoPush.Worker.ThirdSsl/TelpoPush.Worker.ThirdSsl.csproj", "TelpoPush.Worker.ThirdSsl/"]
  7. COPY ["TelpoPush.Common/TelpoPush.Common.csproj", "TelpoPush.Common/"]
  8. COPY ["TelpoPush.Models/TelpoPush.Models.csproj", "TelpoPush.Models/"]
  9. COPY ["TelpoPush.Service/TelpoPush.Service.csproj", "TelpoPush.Service/"]
  10. #RUN dotnet nuget remove source nuget.org
  11. ##RUN dotnet nuget add source https://mirrors.cloud.tencent.com/nuget/ -n tencent_nuget # ÌÚѶ
  12. #RUN dotnet nuget add source https://repo.huaweicloud.com/repository/nuget/v3/index.json -n huaweicloud_nuget #»ªÎª
  13. COPY ["nuget.config","."]
  14. RUN dotnet nuget remove source nuget.org
  15. RUN dotnet nuget add source https://repo.huaweicloud.com/repository/nuget/v3/index.json -n huaweicloud_nuget
  16. RUN dotnet restore "TelpoPush.Worker.ThirdSsl/TelpoPush.Worker.ThirdSsl.csproj"
  17. COPY . .
  18. WORKDIR "/src/TelpoPush.Worker.ThirdSsl"
  19. FROM build AS publish
  20. RUN dotnet publish "TelpoPush.Worker.ThirdSsl.csproj" -c Release -o /app/publish
  21. FROM base AS final
  22. WORKDIR /app
  23. COPY --from=publish /app/publish .
  24. COPY pem /app/pem
  25. ENV environment=Development
  26. RUN apk add --no-cache tzdata
  27. ENV TimeZone=Asia/Shanghai
  28. ENV LANG C.UTF-8
  29. ENV ASPNETCORE_ENVIRONMENT_LOG=Development
  30. RUN ln -snf /usr/share/zoneinfo/$TimeZone /etc/localtime && echo $TimeZone > /etc/timezone
  31. ENTRYPOINT dotnet TelpoPush.Worker.ThirdSsl.dll --environment=$environment