-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
24 lines (20 loc) · 859 Bytes
/
Copy pathDockerfile
File metadata and controls
24 lines (20 loc) · 859 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#Depending on the operating system of the host machines(s) that will build or run the containers, the image specified in the FROM statement may need to be changed.
#For more information, please see https://aka.ms/containercompat
FROM microsoft/dotnet:2.2-aspnetcore-runtime-nanoserver-1803 AS base
WORKDIR /app
EXPOSE 80
FROM microsoft/dotnet:2.2-sdk-nanoserver-1803 AS build
WORKDIR /src
COPY ["ImageApi/ImageApi.csproj", "ImageApi/"]
COPY ["ImageApi.Core/ImageApi.Core.csproj", "ImageApi.Core/"]
COPY ["ImageCore/ImageCore.csproj", "ImageCore/"]
RUN dotnet restore "ImageApi/ImageApi.csproj"
COPY . .
WORKDIR "/src/ImageApi"
RUN dotnet build "ImageApi.csproj" -c Release -o /app
FROM build AS publish
RUN dotnet publish "ImageApi.csproj" -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "ImageApi.dll"]