devops: added dockerfile and other configs

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

12
.dockerignore Normal file
View File

@ -0,0 +1,12 @@
**/bin
**/obj
**/out
**/.vs
**/.idea
**/.git
**/.gitignore
**/node_modules
*.user
*.swp
*.swo
.DS_Store

View File

@ -8,7 +8,7 @@
<ItemGroup>
<PackageReference Include="Asp.Versioning.Mvc.ApiExplorer" Version="8.1.0" />
<PackageReference Include="Core.Blueprint.Logging" Version="1.0.1" />
<PackageReference Include="Core.Blueprint.Logging" Version="1.0.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2" />
</ItemGroup>

View File

@ -7,7 +7,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BuildingBlocks.Library" Version="1.0.0" />
<PackageReference Include="Lib.Architecture.BuildingBlocks" Version="1.0.0" />
</ItemGroup>
</Project>

View File

@ -7,9 +7,9 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Adapters.Lib" Version="1.0.13" />
<PackageReference Include="Core.Adapters.Lib" Version="1.0.0" />
<PackageReference Include="Core.Blueprint.Mongo" Version="1.0.0" />
<PackageReference Include="Core.Blueprint.Redis" Version="1.0.2" />
<PackageReference Include="Core.Blueprint.Redis" Version="1.0.0" />
<PackageReference Include="Mapster" Version="7.4.0" />
</ItemGroup>

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"]

9
nuget.config Normal file
View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<!-- Tu BaGet primero -->
<add key="BaGet" value="https://nuget.dream-views.com/v3/index.json" protocolVersion="3" />
<!-- NuGet oficial como fallback (si quieres) -->
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
</configuration>