chore: rework dockerfiles to account for multi project solution with centralized package+build prop management
This commit is contained in:
@@ -1,14 +0,0 @@
|
||||
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS base
|
||||
WORKDIR /app
|
||||
COPY ./StevesBot.Worker/StevesBot.Worker.csproj ./
|
||||
COPY ./Directory.Build.props ./
|
||||
RUN dotnet restore
|
||||
COPY ./StevesBot.Worker/. ./
|
||||
|
||||
FROM base AS publish-stage
|
||||
RUN dotnet publish -c Release -o dist
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:9.0
|
||||
WORKDIR /app
|
||||
COPY --from=publish-stage /app/dist ./
|
||||
ENTRYPOINT ["dotnet", "StevesBot.Worker.dll"]
|
||||
@@ -0,0 +1,35 @@
|
||||
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS base
|
||||
WORKDIR /app
|
||||
|
||||
# solution level
|
||||
COPY *.sln ./
|
||||
COPY Directory.Build.props ./
|
||||
|
||||
# src level
|
||||
COPY src/StevesBot.Library/*.csproj src/StevesBot.Library/
|
||||
COPY src/StevesBot.Worker/*.csproj src/StevesBot.Worker/
|
||||
COPY src/StevesBot.Webhook/*.csproj src/StevesBot.Webhook/
|
||||
COPY src/Directory.Build.props src/
|
||||
COPY src/Directory.Packages.props src/
|
||||
|
||||
# test level
|
||||
COPY tests/StevesBot.Library.Tests/*.csproj tests/StevesBot.Library.Tests/
|
||||
COPY tests/StevesBot.Worker.Tests/*.csproj tests/StevesBot.Worker.Tests/
|
||||
COPY tests/StevesBot.Webhook.Tests/*.csproj tests/StevesBot.Webhook.Tests/
|
||||
COPY tests/Directory.Build.props tests/
|
||||
COPY tests/Directory.Packages.props tests/
|
||||
|
||||
COPY ./src/StevesBot.Worker/StevesBot.Worker.csproj ./
|
||||
COPY ./Directory.Build.props ./
|
||||
|
||||
RUN dotnet restore StevesBot.sln
|
||||
|
||||
COPY . .
|
||||
|
||||
FROM base AS publish-stage
|
||||
RUN dotnet publish -c Release -o dist src/StevesBot.Webhook/StevesBot.Webhook.csproj
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:9.0
|
||||
WORKDIR /app
|
||||
COPY --from=publish-stage /app/dist ./
|
||||
ENTRYPOINT ["dotnet", "StevesBot.Webhook.dll"]
|
||||
@@ -0,0 +1,35 @@
|
||||
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS base
|
||||
WORKDIR /app
|
||||
|
||||
# solution level
|
||||
COPY *.sln ./
|
||||
COPY Directory.Build.props ./
|
||||
|
||||
# src level
|
||||
COPY src/StevesBot.Library/*.csproj src/StevesBot.Library/
|
||||
COPY src/StevesBot.Worker/*.csproj src/StevesBot.Worker/
|
||||
COPY src/StevesBot.Webhook/*.csproj src/StevesBot.Webhook/
|
||||
COPY src/Directory.Build.props src/
|
||||
COPY src/Directory.Packages.props src/
|
||||
|
||||
# test level
|
||||
COPY tests/StevesBot.Library.Tests/*.csproj tests/StevesBot.Library.Tests/
|
||||
COPY tests/StevesBot.Worker.Tests/*.csproj tests/StevesBot.Worker.Tests/
|
||||
COPY tests/StevesBot.Webhook.Tests/*.csproj tests/StevesBot.Webhook.Tests/
|
||||
COPY tests/Directory.Build.props tests/
|
||||
COPY tests/Directory.Packages.props tests/
|
||||
|
||||
COPY ./src/StevesBot.Worker/StevesBot.Worker.csproj ./
|
||||
COPY ./Directory.Build.props ./
|
||||
|
||||
RUN dotnet restore StevesBot.sln
|
||||
|
||||
COPY . .
|
||||
|
||||
FROM base AS publish-stage
|
||||
RUN dotnet publish -c Release -o dist src/StevesBot.Worker/StevesBot.Worker.csproj
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:9.0
|
||||
WORKDIR /app
|
||||
COPY --from=publish-stage /app/dist ./
|
||||
ENTRYPOINT ["dotnet", "StevesBot.Worker.dll"]
|
||||
Reference in New Issue
Block a user