-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile.API
33 lines (26 loc) · 1.15 KB
/
Dockerfile.API
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
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
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:6.0-bullseye-slim AS base
LABEL maintainer="Donald Gray <[email protected]>,Tom Crane <[email protected]>"
LABEL org.opencontainers.image.source=https://github.com/dlcs/protagonist
LABEL org.opencontainers.image.description="HTTP API for DLCS interactions."
WORKDIR /app
EXPOSE 80
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "API.dll"]