您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

38 行
1.9KB

  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/runtime:6.0 AS base
  3. FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
  4. WORKDIR /app
  5. FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
  6. ARG BUILD_CONFIGURATION=Release
  7. WORKDIR /src
  8. COPY ["nuget.config","."]
  9. COPY ["GpsCardGatewayPosition.Postion/GpsCardGatewayPosition.Postion.csproj", "GpsCardGatewayPosition.Postion/"]
  10. COPY ["GpsCardGatewayPosition.Common/GpsCardGatewayPosition.Common.csproj", "GpsCardGatewayPosition.Common/"]
  11. COPY ["GpsCardGatewayPosition.Model/GpsCardGatewayPosition.Model.csproj", "GpsCardGatewayPosition.Model/"]
  12. COPY ["GpsCardGatewayPosition.Service/GpsCardGatewayPosition.Service.csproj", "GpsCardGatewayPosition.Service/"]
  13. RUN dotnet nuget remove source nuget.org
  14. #RUN dotnet nuget add source https://mirrors.cloud.tencent.com/nuget/ -n tencent_nuget
  15. RUN dotnet nuget add source https://repo.huaweicloud.com/repository/nuget/v3/index.json -n huaweicloud_nuget
  16. RUN dotnet restore "./GpsCardGatewayPosition.Postion/./GpsCardGatewayPosition.Postion.csproj"
  17. COPY . .
  18. WORKDIR "/src/GpsCardGatewayPosition.Postion"
  19. RUN dotnet build "./GpsCardGatewayPosition.Postion.csproj" -c $BUILD_CONFIGURATION -o /app/build
  20. FROM build AS publish
  21. ARG BUILD_CONFIGURATION=Release
  22. RUN dotnet publish "./GpsCardGatewayPosition.Postion.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
  23. FROM base AS final
  24. WORKDIR /app
  25. COPY --from=publish /app/publish .
  26. #ENTRYPOINT ["dotnet", "GpsCardGatewayPosition.Postion.dll"]
  27. ENV environment=Development
  28. ENV TimeZone=Asia/Shanghai
  29. ENV LANG C.UTF-8
  30. RUN ln -snf /usr/share/zoneinfo/$TimeZone /etc/localtime && echo $TimeZone > /etc/timezone
  31. ENTRYPOINT ["sh", "-c", "dotnet GpsCardGatewayPosition.Postion.dll --environment=$environment"]