30 lines
806 B
Docker
30 lines
806 B
Docker
FROM swr.cn-north-4.myhuaweicloud.com/ddn-k8s/mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
|
WORKDIR /src
|
|
|
|
COPY IM_API_NEW.sln ./
|
|
|
|
COPY ConnectorService/ConnectorService.csproj ConnectorService/
|
|
COPY IM.Commons/IM.Commons.csproj IM.Commons/
|
|
COPY IM.InitCommon/IM.InitCommon.csproj IM.InitCommon/
|
|
COPY IM.Protocols/IM.Protocols.csproj IM.Protocols/
|
|
|
|
RUN dotnet restore ConnectorService/ConnectorService.csproj
|
|
|
|
COPY . .
|
|
|
|
RUN dotnet publish ConnectorService/ConnectorService.csproj \
|
|
-c Release \
|
|
-o /app/publish \
|
|
--no-restore
|
|
|
|
FROM swr.cn-north-4.myhuaweicloud.com/ddn-k8s/mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
|
|
WORKDIR /app
|
|
|
|
ENV ASPNETCORE_ENVIRONMENT=Production
|
|
ENV ASPNETCORE_URLS=http://+:8080
|
|
|
|
EXPOSE 8080
|
|
|
|
COPY --from=build /app/publish .
|
|
|
|
ENTRYPOINT ["dotnet", "ConnectorService.dll"] |