-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
27 lines (22 loc) · 1 KB
/
Copy pathDockerfile
File metadata and controls
27 lines (22 loc) · 1 KB
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
# Compilación
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src
# Copiamos los .csproj y restauramos dependencias
COPY ["Intelectia.Domain/Intelectia.Domain.csproj", "Intelectia.Domain/"]
COPY ["Intelectia.Shared/Intelectia.Shared.csproj", "Intelectia.Shared/"]
COPY ["Intelectia.Application/Intelectia.Application.csproj", "Intelectia.Application/"]
COPY ["Intelectia.Infrastructure/Intelectia.Infrastructure.csproj", "Intelectia.Infrastructure/"]
COPY ["Intelectia.API/Intelectia.API.csproj", "Intelectia.API/"]
RUN dotnet restore "Intelectia.API/Intelectia.API.csproj"
# Copiamos el código y publicamos
COPY . .
WORKDIR "/src/Intelectia.API"
RUN dotnet publish "Intelectia.API.csproj" -c Release -o /app/publish /p:UseAppHost=false
# Runtime de Producción
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS final
WORKDIR /app
# .NET 10 usa ASPNETCORE_HTTP_PORTS por defecto en contenedores
ENV ASPNETCORE_HTTP_PORTS=8080
EXPOSE 8080
COPY --from=build /app/publish .
ENTRYPOINT ["dotnet", "Intelectia.API.dll"]