-
-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathDockerfile.jit
More file actions
41 lines (34 loc) · 1.5 KB
/
Copy pathDockerfile.jit
File metadata and controls
41 lines (34 loc) · 1.5 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
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base
RUN apt-get update && apt-get install -y --no-install-recommends libgssapi-krb5-2 && rm -rf /var/lib/apt/lists/*
WORKDIR /app
EXPOSE 5000
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src
# Copy project files
COPY NpgsqlRest/*.csproj NpgsqlRest/
COPY NpgsqlRestClient/*.csproj NpgsqlRestClient/
COPY plugins/NpgsqlRest.CrudSource/*.csproj plugins/NpgsqlRest.CrudSource/
COPY plugins/NpgsqlRest.HttpFiles/*.csproj plugins/NpgsqlRest.HttpFiles/
COPY plugins/NpgsqlRest.OpenApi/*.csproj plugins/NpgsqlRest.OpenApi/
COPY plugins/NpgsqlRest.TsClient/*.csproj plugins/NpgsqlRest.TsClient/
# Restore dependencies
RUN dotnet restore NpgsqlRestClient/NpgsqlRestClient.csproj
# Copy everything else
COPY LICENSE LICENSE
COPY README.md README.MD
COPY NpgsqlRest/ NpgsqlRest/
# Shared source compiled into NpgsqlRest.csproj (<Compile Include="..\NpgsqlRest.Common\*.cs"/> + global
# usings). Without this the JIT build fails: NpgsqlRest.GlobalUsings.g.cs -> CS0234 'NpgsqlRest.Common'.
COPY NpgsqlRest.Common/ NpgsqlRest.Common/
COPY NpgsqlRestClient/*.cs NpgsqlRestClient/
COPY NpgsqlRestClient/*.csproj NpgsqlRestClient/
COPY NpgsqlRestClient/appsettings.json NpgsqlRestClient/
COPY NpgsqlRestClient/Fido2/ NpgsqlRestClient/Fido2/
COPY plugins/ plugins/
# Build and publish
WORKDIR /src/NpgsqlRestClient
RUN dotnet publish -c Release -o /app/publish -p:PublishAot=false
FROM base AS final
WORKDIR /app
COPY --from=build /app/publish .
ENTRYPOINT ["dotnet", "NpgsqlRestClient.dll"]