-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile.API
More file actions
34 lines (27 loc) · 1.22 KB
/
Dockerfile.API
File metadata and controls
34 lines (27 loc) · 1.22 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
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
COPY ["Directory.Build.props", "Directory.Packages.props", "."]
COPY ["API/API.csproj", "API/"]
COPY ["DLCS.Repository/DLCS.Repository.csproj", "DLCS.Repository/"]
COPY ["DLCS.Model/DLCS.Model.csproj", "DLCS.Model/"]
COPY ["DLCS.Core/DLCS.Core.csproj", "DLCS.Core/"]
COPY ["DLCS.Mediatr/DLCS.Mediatr.csproj", "DLCS.Mediatr/"]
COPY ["DLCS.Web/DLCS.Web.csproj", "DLCS.Web/"]
COPY ["DLCS.AWS/DLCS.AWS.csproj", "DLCS.AWS/"]
COPY ["Hydra/Hydra.csproj", "Hydra/"]
COPY ["DLCS.HydraModel/DLCS.HydraModel.csproj", "DLCS.HydraModel/"]
COPY ["API.Client/API.Client.csproj", "API.Client/"]
RUN dotnet restore "API/API.csproj"
COPY . .
WORKDIR "/src/API"
RUN dotnet build "API.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "API.csproj" -c Release -o /app/publish
FROM mcr.microsoft.com/dotnet/aspnet:8.0-bookworm-slim AS base
LABEL maintainer="Donald Gray <donald.gray@digirati.com>,Tom Crane <tom.crane@digirati.com>"
LABEL org.opencontainers.image.source=https://github.com/dlcs/protagonist
LABEL org.opencontainers.image.description="HTTP API for DLCS interactions."
WORKDIR /app
EXPOSE 8080
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "API.dll"]