feat: dockerized version

This commit is contained in:
2025-09-02 14:00:24 -06:00
parent 21f5945272
commit 0affc6ebf4
5 changed files with 66 additions and 2 deletions

17
.dockerignore Normal file
View File

@@ -0,0 +1,17 @@
**/bin/
**/obj/
**/.vs/
**/.idea/
**/.vscode/
**/*.user
**/*.suo
**/*.swp
**/*.csproj.user
**/*.log
**/Properties/launchSettings.json
**/appsettings.Local.json
**/appsettings.*.Development.json
.git/
.gitignore
Dockerfile
docker-compose*.yml

View File

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

View File

@@ -7,7 +7,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Core.Thalos.BuildingBlocks" Version="1.1.8" />
<PackageReference Include="Core.Thalos.BuildingBlocks" Version="1.0.5" />
<PackageReference Include="Lib.Architecture.BuildingBlocks" Version="1.0.0" />
<PackageReference Include="Refit" Version="8.0.0" />
</ItemGroup>

38
Dockerfile Normal file
View File

@@ -0,0 +1,38 @@
# ============ Build ============
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
# (opcional) si tienes nuget.config
COPY nuget.config* ./
# Cache de restore por proyecto
COPY Core.Thalos.External/Core.Thalos.External.csproj Core.Thalos.External/
COPY Core.Thalos.BFF.Api/Core.Thalos.BFF.Api.csproj Core.Thalos.BFF.Api/
RUN dotnet restore Core.Thalos.BFF.Api/Core.Thalos.BFF.Api.csproj
# Copia del resto + build
COPY . .
RUN dotnet build Core.Thalos.BFF.Api/Core.Thalos.BFF.Api.csproj -c Release -o /app/build
# ============ Publish ============
FROM build AS publish
RUN dotnet publish Core.Thalos.BFF.Api/Core.Thalos.BFF.Api.csproj -c Release -o /app/publish --no-restore
# ============ Runtime ============
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS final
# curl (opcional) si luego cambias a healthcheck HTTP
RUN apt-get update && apt-get install -y --no-install-recommends curl && rm -rf /var/lib/apt/lists/*
WORKDIR /app
EXPOSE 8080
# Usuario no-root
RUN useradd -m appuser
USER appuser
ENV ASPNETCORE_URLS=http://+:8080
# La app agrega UserSecrets/ENV/KeyVault/Auth en runtime (no hornear secretos). :contentReference[oaicite:9]{index=9}
COPY --from=publish /app/publish ./
ENTRYPOINT ["dotnet", "Core.Thalos.BFF.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>