chore: add Dockerfiles for Api and Worker
- Api: mcr.microsoft.com/dotnet/aspnet:10.0 base, exposes 8080 - Worker: mcr.microsoft.com/dotnet/runtime:10.0 base (no HTTP stack) - Both use multi-stage build with layer-cached csproj restore - .dockerignore excludes bin/obj/git/IDE folders - Dockerfiles added to /docker/ solution folder Ref: IT-628 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
# syntax=docker/dockerfile:1.4
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/runtime:10.0 AS base
|
||||
WORKDIR /app
|
||||
|
||||
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
WORKDIR /src
|
||||
|
||||
COPY ["Directory.Build.props", "."]
|
||||
COPY ["Directory.Packages.props", "."]
|
||||
COPY ["HrynCo.NotificationService.DAL.Abstract/HrynCo.NotificationService.DAL.Abstract.csproj", "HrynCo.NotificationService.DAL.Abstract/"]
|
||||
COPY ["HrynCo.NotificationService.DAL.EF/HrynCo.NotificationService.DAL.EF.csproj", "HrynCo.NotificationService.DAL.EF/"]
|
||||
COPY ["HrynCo.NotificationService.Services/HrynCo.NotificationService.Services.csproj", "HrynCo.NotificationService.Services/"]
|
||||
COPY ["HrynCo.NotificationService.Worker/HrynCo.NotificationService.Worker.csproj", "HrynCo.NotificationService.Worker/"]
|
||||
|
||||
RUN dotnet restore "HrynCo.NotificationService.Worker/HrynCo.NotificationService.Worker.csproj"
|
||||
|
||||
COPY . .
|
||||
|
||||
WORKDIR "/src/HrynCo.NotificationService.Worker"
|
||||
RUN dotnet build "./HrynCo.NotificationService.Worker.csproj" -c $BUILD_CONFIGURATION -o /app/build
|
||||
|
||||
FROM build AS publish
|
||||
ARG BUILD_CONFIGURATION=Release
|
||||
RUN dotnet publish "./HrynCo.NotificationService.Worker.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
|
||||
|
||||
FROM base AS final
|
||||
WORKDIR /app
|
||||
COPY --from=publish /app/publish .
|
||||
ENTRYPOINT ["dotnet", "HrynCo.NotificationService.Worker.dll"]
|
||||
Reference in New Issue
Block a user