-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace node build image by dotnet/sdk image (#2885)
- Loading branch information
1 parent
244ac48
commit 7aa23fb
Showing
1 changed file
with
28 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,28 @@ | ||
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. | ||
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base | ||
WORKDIR /app | ||
EXPOSE 80 | ||
EXPOSE 443 | ||
|
||
FROM node:14-bullseye AS build | ||
|
||
RUN wget https://packages.microsoft.com/config/debian/11/packages-microsoft-prod.deb -O packages-microsoft-prod.deb | ||
RUN dpkg -i packages-microsoft-prod.deb | ||
RUN rm packages-microsoft-prod.deb | ||
RUN apt-get update; \ | ||
apt-get install -y apt-transport-https && \ | ||
apt-get update && \ | ||
apt-get install -y dotnet-sdk-8.0 | ||
|
||
FROM build AS builder | ||
ARG BUILD_VERSION=1.2.3 | ||
ARG GITHUB_RUN_NUMBER=4 | ||
WORKDIR /src | ||
COPY ["IoTHub.Portal.Server/IoTHub.Portal.Server.csproj", "IoTHub.Portal.Server/"] | ||
COPY ["IoTHub.Portal.Shared/IoTHub.Portal.Shared.csproj", "IoTHub.Portal.Shared/"] | ||
COPY ["IoTHub.Portal.Client/IoTHub.Portal.Client.csproj", "IoTHub.Portal.Client/"] | ||
RUN dotnet restore "IoTHub.Portal.Server/IoTHub.Portal.Server.csproj" | ||
COPY . . | ||
WORKDIR "/src/IoTHub.Portal.Server" | ||
RUN dotnet build "IoTHub.Portal.Server.csproj" -c Release -o /app/build -p:Version="${BUILD_VERSION}.${GITHUB_RUN_NUMBER}" -p:ClientAssetsRestoreCommand="npm ci" | ||
|
||
FROM builder AS publish | ||
ARG BUILD_VERSION=1.2.3 | ||
ARG GITHUB_RUN_NUMBER=4 | ||
RUN dotnet publish "IoTHub.Portal.Server.csproj" -c Release -o /app/publish -p:Version="${BUILD_VERSION}.${GITHUB_RUN_NUMBER}" -p:ClientAssetsRestoreCommand="npm ci" | ||
|
||
FROM base AS final | ||
WORKDIR /app | ||
COPY --from=publish /app/publish . | ||
ENTRYPOINT ["dotnet", "IoTHub.Portal.Server.dll"] | ||
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging. | ||
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base | ||
WORKDIR /app | ||
EXPOSE 80 | ||
EXPOSE 443 | ||
|
||
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build | ||
ARG BUILD_VERSION=1.2.3 | ||
ARG GITHUB_RUN_NUMBER=4 | ||
WORKDIR /src | ||
RUN ls | ||
COPY ["IoTHub.Portal.Server/IoTHub.Portal.Server.csproj", "IoTHub.Portal.Server/"] | ||
COPY ["IoTHub.Portal.Shared/IoTHub.Portal.Shared.csproj", "IoTHub.Portal.Shared/"] | ||
COPY ["IoTHub.Portal.Client/IoTHub.Portal.Client.csproj", "IoTHub.Portal.Client/"] | ||
RUN dotnet restore "IoTHub.Portal.Server/IoTHub.Portal.Server.csproj" | ||
COPY . . | ||
WORKDIR "/src/IoTHub.Portal.Server" | ||
RUN dotnet build "IoTHub.Portal.Server.csproj" -c Release -o /app/build -p:Version="${BUILD_VERSION}.${GITHUB_RUN_NUMBER}" | ||
|
||
FROM build AS publish | ||
ARG BUILD_VERSION=1.2.3 | ||
ARG GITHUB_RUN_NUMBER=4 | ||
RUN dotnet publish "IoTHub.Portal.Server.csproj" -c Release -o /app/publish -p:Version="${BUILD_VERSION}.${GITHUB_RUN_NUMBER}" | ||
|
||
FROM base AS final | ||
WORKDIR /app | ||
COPY --from=publish /app/publish . | ||
ENTRYPOINT ["dotnet", "IoTHub.Portal.Server.dll"] |