-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.api
More file actions
29 lines (21 loc) · 977 Bytes
/
Dockerfile.api
File metadata and controls
29 lines (21 loc) · 977 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Используем SDK-образ для сборки
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /app
# Копируем csproj-файлы и восстанавливаем зависимости
COPY TemplateService.Domain/TemplateService.Domain.csproj TemplateService.Domain/
COPY TemplateService.Application/TemplateService.Application.csproj TemplateService.Application/
COPY TemplateService.Infrastructure/TemplateService.Infrastructure.csproj TemplateService.Infrastructure/
COPY TemplateService.API/TemplateService.API.csproj TemplateService.API/
RUN dotnet restore TemplateService.API/TemplateService.API.csproj
# Копируем остальной код
COPY . .
# Сборка
WORKDIR /app/TemplateService.API
RUN dotnet publish -c Release -o /out
# Runtime stage
FROM mcr.microsoft.com/dotnet/aspnet:8.0
WORKDIR /app
COPY --from=build /out ./
ENV ASPNETCORE_URLS=http://+:5124
EXPOSE 5124
ENTRYPOINT ["dotnet", "TemplateService.API.dll"]