-
Notifications
You must be signed in to change notification settings - Fork 0
/
dockerfile
23 lines (20 loc) · 866 Bytes
/
dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
ARG RESOURCE_REAPER_SESSION_ID="00000000-0000-0000-0000-000000000000"
LABEL "testcontainers.resource-reaper-session"=$RESOURCE_REAPER_SESSION_ID
WORKDIR /app
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
ARG RESOURCE_REAPER_SESSION_ID="00000000-0000-0000-0000-000000000000"
LABEL "testcontainers.resource-reaper-session"=$RESOURCE_REAPER_SESSION_ID
WORKDIR /src
COPY ["src/Component.csproj", "Component/"]
RUN dotnet restore "Component/Component.csproj"
COPY . .
WORKDIR /src
RUN dotnet build "src/Component.csproj" -c Release -o /app/build
FROM build AS Publish
RUN dotnet publish "src/Component.csproj" -c Release --verbosity=diag -o /app/publish /p:UseAppHost=false
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENV ASPNETCORE_ENVIRONMENT=Development
ENTRYPOINT ["dotnet", "Component.dll"]