feat: dockerized version

This commit is contained in:
2025-09-02 14:00:55 -06:00
parent a4c4f2bd8b
commit ccf267845d
5 changed files with 69 additions and 4 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

@@ -7,9 +7,9 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="BuildingBlocks.Library" Version="1.0.1" /> <PackageReference Include="Lib.Architecture.BuildingBlocks" Version="1.0.0" />
<PackageReference Include="Core.Blueprint.Storage" Version="1.0.1" /> <PackageReference Include="Core.Blueprint.Storage" Version="1.0.0" />
<PackageReference Include="Core.Thalos.BuildingBlocks" Version="1.1.9" /> <PackageReference Include="Core.Thalos.BuildingBlocks" Version="1.0.5" />
<PackageReference Include="Refit" Version="8.0.0" /> <PackageReference Include="Refit" Version="8.0.0" />
</ItemGroup> </ItemGroup>

View File

@@ -8,7 +8,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Core.Blueprint.Logging" Version="1.0.1" /> <PackageReference Include="Core.Blueprint.Logging" Version="1.0.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

39
Dockerfile Normal file
View File

@@ -0,0 +1,39 @@
# ============ Build ============
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
# (Opcional) si usas nuget.config en el root
COPY nuget.config* ./
# Copiamos csprojs primero para cachear restore
COPY Core.Thalos.Application/Core.Thalos.Application.csproj Core.Thalos.Application/
COPY Core.Thalos.External/Core.Thalos.External.csproj Core.Thalos.External/
COPY Core.Thalos.Service.API/Core.Thalos.Service.API.csproj Core.Thalos.Service.API/
RUN dotnet restore Core.Thalos.Service.API/Core.Thalos.Service.API.csproj
# Copia del resto y build
COPY . .
RUN dotnet build Core.Thalos.Service.API/Core.Thalos.Service.API.csproj -c Release -o /app/build
# ============ Publish ============
FROM build AS publish
RUN dotnet publish Core.Thalos.Service.API/Core.Thalos.Service.API.csproj -c Release -o /app/publish --no-restore
# ============ Runtime ============
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS final
# (Opcional) curl para 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 usa UserSecrets y EnvironmentVariables (no metas secretos en la imagen). :contentReference[oaicite:4]{index=4}
COPY --from=publish /app/publish ./
ENTRYPOINT ["dotnet", "Core.Thalos.Service.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>