Skip to content

Commit a45e1d6

Browse files
committed
Add Dockerfile per project
1 parent 5fc0220 commit a45e1d6

2 files changed

Lines changed: 40 additions & 0 deletions

File tree

src/DataConsumer/Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
2+
3+
FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim AS base
4+
WORKDIR /app
5+
6+
FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim AS build
7+
WORKDIR /src
8+
COPY ["src/DataConsumer/DataConsumer.csproj", "src/"]
9+
RUN dotnet restore "src/DataConsumer/DataConsumer.csproj"
10+
COPY . .
11+
WORKDIR "/src/src"
12+
RUN dotnet build "DataConsumer.csproj" -c Release -o /app/build
13+
14+
FROM build AS publish
15+
RUN dotnet publish "DataConsumer.csproj" -c Release -o /app/publish
16+
17+
FROM base AS final
18+
WORKDIR /app
19+
COPY --from=publish /app/publish .
20+
ENTRYPOINT ["dotnet", "DataConsumer.dll"]

src/WebhookProcessor/Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
2+
3+
FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim AS base
4+
WORKDIR /app
5+
6+
FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim AS build
7+
WORKDIR /src
8+
COPY ["src/WebhookProcessor/WebhookProcessor.csproj", "src/"]
9+
RUN dotnet restore "src/WebhookProcessor/WebhookProcessor.csproj"
10+
COPY . .
11+
WORKDIR "/src/src"
12+
RUN dotnet build "WebhookProcessor.csproj" -c Release -o /app/build
13+
14+
FROM build AS publish
15+
RUN dotnet publish "WebhookProcessor.csproj" -c Release -o /app/publish
16+
17+
FROM base AS final
18+
WORKDIR /app
19+
COPY --from=publish /app/publish .
20+
ENTRYPOINT ["dotnet", "WebhookProcessor.dll"]

0 commit comments

Comments
 (0)