|
- #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/runtime:6.0 AS base
- FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
- WORKDIR /app
-
- FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
- ARG BUILD_CONFIGURATION=Release
- WORKDIR /src
- COPY ["nuget.config","."]
- COPY ["GpsCardGatewayPosition.Postion/GpsCardGatewayPosition.Postion.csproj", "GpsCardGatewayPosition.Postion/"]
- COPY ["GpsCardGatewayPosition.Common/GpsCardGatewayPosition.Common.csproj", "GpsCardGatewayPosition.Common/"]
- COPY ["GpsCardGatewayPosition.Model/GpsCardGatewayPosition.Model.csproj", "GpsCardGatewayPosition.Model/"]
- COPY ["GpsCardGatewayPosition.Service/GpsCardGatewayPosition.Service.csproj", "GpsCardGatewayPosition.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
-
- RUN dotnet restore "./GpsCardGatewayPosition.Postion/./GpsCardGatewayPosition.Postion.csproj"
- COPY . .
- WORKDIR "/src/GpsCardGatewayPosition.Postion"
- RUN dotnet build "./GpsCardGatewayPosition.Postion.csproj" -c $BUILD_CONFIGURATION -o /app/build
-
- FROM build AS publish
- ARG BUILD_CONFIGURATION=Release
- RUN dotnet publish "./GpsCardGatewayPosition.Postion.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
-
- FROM base AS final
- WORKDIR /app
- COPY --from=publish /app/publish .
- #ENTRYPOINT ["dotnet", "GpsCardGatewayPosition.Postion.dll"]
- 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 ["sh", "-c", "dotnet GpsCardGatewayPosition.Postion.dll --environment=$environment"]
|