33 lines
1.0 KiB
Docker
33 lines
1.0 KiB
Docker
# ===== Build stage =====
|
|
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
|
|
WORKDIR /src
|
|
|
|
# Copia nuget.config de la raíz (con BaGet + nuget.org)
|
|
COPY nuget.config ./
|
|
|
|
# Copia SOLO los .csproj que DAL necesita (para cache de restore)
|
|
COPY Core.Inventory.DAL.API/Core.Inventory.DAL.API.csproj Core.Inventory.DAL.API/
|
|
COPY Core.Inventory.Domain/Core.Inventory.Domain.csproj Core.Inventory.Domain/
|
|
COPY Core.Inventory.Provider/Core.Inventory.Provider.csproj Core.Inventory.Provider/
|
|
|
|
# Restaura usando nuget.config
|
|
RUN dotnet restore Core.Inventory.DAL.API/Core.Inventory.DAL.API.csproj --configfile ./nuget.config
|
|
|
|
# Copia el resto del código
|
|
COPY . .
|
|
|
|
# Publica artefactos listos para runtime
|
|
RUN dotnet publish Core.Inventory.DAL.API/Core.Inventory.DAL.API.csproj \
|
|
-c Release -o /app/out /p:UseAppHost=false
|
|
|
|
# ===== Runtime stage =====
|
|
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
|
|
WORKDIR /app
|
|
COPY --from=build /app/out .
|
|
|
|
# Configuración básica
|
|
ENV ASPNETCORE_URLS=http://+:8080
|
|
EXPOSE 8080
|
|
|
|
ENTRYPOINT ["dotnet", "Core.Inventory.DAL.API.dll"]
|