Files
hrynco-notification-service/HrynCo.NotificationService.Api/Dockerfile
T
Anatolii Grynchuk 6a31f380a2 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>
2026-05-02 01:33:22 +03:00

32 lines
1.3 KiB
Docker

# syntax=docker/dockerfile:1.4
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS base
WORKDIR /app
EXPOSE 8080
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.Api/HrynCo.NotificationService.Api.csproj", "HrynCo.NotificationService.Api/"]
RUN dotnet restore "HrynCo.NotificationService.Api/HrynCo.NotificationService.Api.csproj"
COPY . .
WORKDIR "/src/HrynCo.NotificationService.Api"
RUN dotnet build "./HrynCo.NotificationService.Api.csproj" -c $BUILD_CONFIGURATION -o /app/build
FROM build AS publish
ARG BUILD_CONFIGURATION=Release
RUN dotnet publish "./HrynCo.NotificationService.Api.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.Api.dll"]