devops: added dockerfile and other configs
This commit is contained in:
parent
1818de98c0
commit
af51189640
12
.dockerignore
Normal file
12
.dockerignore
Normal file
@ -0,0 +1,12 @@
|
||||
**/bin
|
||||
**/obj
|
||||
**/out
|
||||
**/.vs
|
||||
**/.idea
|
||||
**/.git
|
||||
**/.gitignore
|
||||
**/node_modules
|
||||
*.user
|
||||
*.swp
|
||||
*.swo
|
||||
.DS_Store
|
||||
@ -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>
|
||||
|
||||
|
||||
@ -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>
|
||||
|
||||
@ -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
32
Dockerfile
Normal 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
9
nuget.config
Normal 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>
|
||||
Loading…
Reference in New Issue
Block a user