-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.grpc
28 lines (25 loc) · 1.05 KB
/
Dockerfile.grpc
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
27
28
# https://hub.docker.com/_/microsoft-dotnet
FROM mcr.microsoft.com/dotnet/sdk:5.0.102-ca-patch-buster-slim-amd64 AS build
WORKDIR /source
# copy csproj and restore as distinct layers
COPY *.sln .
COPY KeyCrawler.GrpcApi/*.csproj ./KeyCrawler.GrpcApi/
COPY KeyCrawler.WebApi/*.csproj ./KeyCrawler.WebApi/
COPY KeyCrawler.Service/*.csproj ./KeyCrawler.Service/
COPY KeyCrawler.Persistence/*.csproj ./KeyCrawler.Persistence/
COPY KeyCrawler.Domain/*.csproj ./KeyCrawler.Domain/
COPY KeyCrawler.Contracts/*.csproj ./KeyCrawler.Contracts/
RUN dotnet restore
# copy everything else and build app
COPY KeyCrawler.GrpcApi/. ./KeyCrawler.GrpcApi/
COPY KeyCrawler.Service/. ./KeyCrawler.Service/
COPY KeyCrawler.Persistence/. ./KeyCrawler.Persistence/
COPY KeyCrawler.Domain/. ./KeyCrawler.Domain/
COPY KeyCrawler.Contracts/. ./KeyCrawler.Contracts/
WORKDIR /source
RUN dotnet publish ./KeyCrawler.GrpcApi/ -c release -o /app --no-restore
# final stage/image
FROM mcr.microsoft.com/dotnet/aspnet:5.0
WORKDIR /app
COPY --from=build /app ./
ENTRYPOINT ["dotnet", "KeyCrawler.GrpcApi.dll"]