devops: added dockerfile and other configs

This commit is contained in:
2025-09-01 10:19:45 -06:00
parent 1818de98c0
commit af51189640
6 changed files with 57 additions and 4 deletions

32
Dockerfile Normal file
View File

@@ -0,0 +1,32 @@
# ===== 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"]