feat: dockerized version
This commit is contained in:
17
.dockerignore
Normal file
17
.dockerignore
Normal 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
|
||||
@@ -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>
|
||||
|
||||
@@ -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
38
Dockerfile
Normal 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
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>
|
||||
Reference in New Issue
Block a user