-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
54 lines (45 loc) · 2.35 KB
/
Dockerfile
File metadata and controls
54 lines (45 loc) · 2.35 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# https://hub.docker.com/_/microsoft-dotnet
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /source
# create local nuget packages
COPY nuget.config ./
COPY Service.Abstractions/ ./Service.Abstractions/
COPY Service.Libraries.Redis/ ./Service.Libraries.Redis/
COPY Service.AppHost.Common/ ./Service.AppHost.Common/
COPY Service.Application.Common/. ./Service.Application.Common/
COPY Service.Api.Common/. ./Service.Api.Common/
COPY AsyncApiBindingsGenerator/. ./AsyncApiBindingsGenerator/
COPY AsyncApiApplicationSupportGenerator/. ./AsyncApiApplicationSupportGenerator/
COPY RequestDecoratorGenerator/. ./RequestDecoratorGenerator/
RUN mkdir local-nuget-feed
RUN dotnet pack -c release -o ./local-nuget-feed ./Service.Abstractions/
RUN dotnet pack -c release -o ./local-nuget-feed ./Service.Libraries.Redis/
RUN dotnet pack -c release -o ./local-nuget-feed ./Service.AppHost.Common/
RUN dotnet pack -c release -o ./local-nuget-feed ./Service.Application.Common/
RUN dotnet pack -c release -o ./local-nuget-feed ./Service.Api.Common/
RUN dotnet pack -c release -o ./local-nuget-feed ./AsyncApiBindingsGenerator/
RUN dotnet pack -c release -o ./local-nuget-feed ./AsyncApiApplicationSupportGenerator/
RUN dotnet pack -c release -o ./local-nuget-feed ./RequestDecoratorGenerator/
# copy csproj and restore as distinct layers
COPY *.slnx .
COPY RatingService.AppHost/*.csproj ./RatingService.AppHost/
COPY RatingService.Api/*.csproj ./RatingService.Api/
COPY RatingService.Application/*.csproj ./RatingService.Application/
COPY RatingService.Infrastructure/*.csproj ./RatingService.Infrastructure/
COPY RatingService.Infrastructure.DesignTime/*.csproj ./RatingService.Infrastructure.DesignTime/
COPY RatingService.Domain/*.csproj ./RatingService.Domain/
RUN dotnet restore
# copy everything else and build app
COPY RatingService.AppHost/. ./RatingService.AppHost/
COPY RatingService.Api/. ./RatingService.Api/
COPY RatingService.Application/. ./RatingService.Application/
COPY RatingService.Infrastructure/. ./RatingService.Infrastructure/
COPY RatingService.Domain/. ./RatingService.Domain/
WORKDIR /source/RatingService.AppHost
RUN dotnet publish -c release -o /app --no-restore
# final stage/image
FROM mcr.microsoft.com/dotnet/runtime:10.0
WORKDIR /app
COPY --from=build /app ./
RUN apt-get update && apt-get install -y libgssapi-krb5-2
ENTRYPOINT ["dotnet", "RatingService.AppHost.dll"]