Files
hrynco-notification-service/HrynCo.NotificationService.Migrator/Dockerfile
T
Anatolii Grynchuk a8bc26fe38 feat: add Migrator console project
- Dedicated HrynCo.NotificationService.Migrator console app
- Reads App:ConnectionString from config/env
- Calls db.Database.MigrateAsync() with clear log output
- Own Dockerfile (runtime:10.0 base, no SDK overhead)
- Replaces SDK volume-mount approach in docker-compose
- Added to solution with /docker/Migrator/ folder

Ref: IT-628

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-02 02:24:45 +03:00

18 lines
934 B
Docker

FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src
COPY ["HrynCo.NotificationService.Migrator/HrynCo.NotificationService.Migrator.csproj", "HrynCo.NotificationService.Migrator/"]
COPY ["HrynCo.NotificationService.DAL.EF/HrynCo.NotificationService.DAL.EF.csproj", "HrynCo.NotificationService.DAL.EF/"]
COPY ["HrynCo.NotificationService.DAL.Abstract/HrynCo.NotificationService.DAL.Abstract.csproj", "HrynCo.NotificationService.DAL.Abstract/"]
COPY ["Directory.Packages.props", "./"]
COPY ["Directory.Build.props", "./"]
RUN dotnet restore "HrynCo.NotificationService.Migrator/HrynCo.NotificationService.Migrator.csproj"
COPY . .
RUN dotnet publish "HrynCo.NotificationService.Migrator/HrynCo.NotificationService.Migrator.csproj" -c Release -o /app/publish --no-restore
FROM mcr.microsoft.com/dotnet/runtime:10.0
WORKDIR /app
COPY --from=build /app/publish .
ENTRYPOINT ["dotnet", "HrynCo.NotificationService.Migrator.dll"]