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 | ||||
| @@ -15,7 +15,7 @@ | ||||
|   </ItemGroup> | ||||
|  | ||||
|   <ItemGroup> | ||||
|     <PackageReference Include="Core.Blueprint.Logging" Version="1.0.1" /> | ||||
|     <PackageReference Include="Core.Blueprint.Logging" Version="1.0.0" /> | ||||
|   </ItemGroup> | ||||
|  | ||||
|   <ItemGroup> | ||||
|   | ||||
| @@ -7,8 +7,8 @@ | ||||
|   </PropertyGroup> | ||||
|  | ||||
|   <ItemGroup> | ||||
|     <PackageReference Include="Core.Blueprint.KeyVault" Version="1.0.3" /> | ||||
|     <PackageReference Include="Core.Thalos.BuildingBlocks" Version="1.1.8" /> | ||||
|     <PackageReference Include="Core.Blueprint.KeyVault" Version="1.0.0" /> | ||||
|     <PackageReference Include="Core.Thalos.BuildingBlocks" Version="1.0.5" /> | ||||
|   </ItemGroup> | ||||
|  | ||||
| </Project> | ||||
|   | ||||
| @@ -11,8 +11,8 @@ | ||||
|   </ItemGroup> | ||||
|  | ||||
|   <ItemGroup> | ||||
|     <PackageReference Include="Core.Blueprint.Mongo" Version="1.0.1" /> | ||||
|     <PackageReference Include="Core.Blueprint.Redis" Version="1.0.3" /> | ||||
|     <PackageReference Include="Core.Blueprint.Mongo" Version="1.0.0" /> | ||||
|     <PackageReference Include="Core.Blueprint.Redis" Version="1.0.0" /> | ||||
|     <PackageReference Include="Mapster" Version="7.4.2-pre02" /> | ||||
|   </ItemGroup> | ||||
|  | ||||
|   | ||||
							
								
								
									
										40
									
								
								Dockerfile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										40
									
								
								Dockerfile
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,40 @@ | ||||
| # ============ Build ============ | ||||
| FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build | ||||
| WORKDIR /src | ||||
|  | ||||
| # Copia opcional del nuget.config si existe en el root | ||||
| COPY nuget.config* ./ | ||||
|  | ||||
| # Copiamos csprojs primero para aprovechar caché de restore | ||||
| COPY Core.Thalos.Domain/Core.Thalos.Domain.csproj Core.Thalos.Domain/ | ||||
| COPY Core.Thalos.Provider/Core.Thalos.Provider.csproj Core.Thalos.Provider/ | ||||
| COPY Core.Thalos.Infraestructure/Core.Thalos.Infrastructure.csproj Core.Thalos.Infraestructure/ | ||||
| COPY Core.Thalos.DAL.API/Core.Thalos.DAL.API.csproj Core.Thalos.DAL.API/ | ||||
|  | ||||
| RUN dotnet restore Core.Thalos.DAL.API/Core.Thalos.DAL.API.csproj | ||||
|  | ||||
| # Copiamos el resto y compilamos | ||||
| COPY . . | ||||
| RUN dotnet build Core.Thalos.DAL.API/Core.Thalos.DAL.API.csproj -c Release -o /app/build | ||||
|  | ||||
| # ============ Publish ============ | ||||
| FROM build AS publish | ||||
| RUN dotnet publish Core.Thalos.DAL.API/Core.Thalos.DAL.API.csproj -c Release -o /app/publish \ | ||||
|     --no-restore | ||||
|  | ||||
| # ============ Runtime ============ | ||||
| FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS final | ||||
| # (Opcional) instalar 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 | ||||
| # Usa env vars y/o UserSecrets; no guardes tokens en la imagen.  :contentReference[oaicite:4]{index=4} | ||||
|  | ||||
| COPY --from=publish /app/publish ./ | ||||
| ENTRYPOINT ["dotnet", "Core.Thalos.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> | ||||
		Reference in New Issue
	
	Block a user