-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
26 lines (19 loc) · 944 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# 1. Build application in image
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /Source
COPY ["Source/CBD.ShoppingService.WebAPI/CBD.ShoppingService.WebAPI.csproj", "CBD.ShoppingService.WebAPI/"]
COPY ["Source/CBD.ShoppingService.Port/CBD.ShoppingService.Port.csproj", "CBD.ShoppingService.Port/"]
COPY ["Source/CBD.ShoppingService.Core/CBD.ShoppingService.Core.csproj", "CBD.ShoppingService.Core/"]
RUN dotnet restore "CBD.ShoppingService.WebAPI/CBD.ShoppingService.WebAPI.csproj"
COPY ./Source .
WORKDIR "/Source/CBD.ShoppingService.WebAPI"
RUN dotnet build "CBD.ShoppingService.WebAPI.csproj" -c Release -o /app/build
# 2. Publish built application in image
FROM build AS publish
RUN dotnet publish "CBD.ShoppingService.WebAPI.csproj" -c Release -o /app/publish
# 3. Take published version
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS final
EXPOSE 7002
WORKDIR /app
COPY --from=publish /app/publish .
RUN dotnet dev-certs https