Deat Dockerfiles y Fix Base_URL

This commit is contained in:
2025-10-07 15:18:11 -03:00
parent 04f1134be4
commit be7b6a732d
13 changed files with 135 additions and 8 deletions

25
backend/Dockerfile Normal file
View File

@@ -0,0 +1,25 @@
# --- Etapa 1: Build ---
# Usamos la imagen del SDK de .NET 8 para compilar
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
WORKDIR /src
# Copiamos el archivo .csproj para restaurar dependencias primero (cache optimization)
COPY Inventario.API/Inventario.API.csproj Inventario.API/
RUN dotnet restore "Inventario.API/Inventario.API.csproj"
# Copiamos el resto del código fuente
COPY . .
# Publicamos la aplicación en modo Release
WORKDIR "/src/Inventario.API"
RUN dotnet publish "Inventario.API.csproj" -c Release -o /app/publish /p:UseAppHost=false
# --- Etapa 2: Final ---
# Usamos la imagen de runtime de ASP.NET, mucho más ligera
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS final
WORKDIR /app
COPY --from=build /app/publish .
# El puerto por defecto que exponen los contenedores de .NET es 8080
EXPOSE 8080
ENTRYPOINT ["dotnet", "Inventario.API.dll"]

View File

@@ -7,7 +7,7 @@
},
"AllowedHosts": "*",
"ConnectionStrings": {
"DefaultConnection": "Server=TECNICA3;Database=InventarioDB;User Id=apiequipos;Password=@Apiequipos513@;TrustServerCertificate=True"
"DefaultConnection": "Server=db-sqlserver;Database=InventarioDB;User Id=apiequipos;Password=@Apiequipos513@;TrustServerCertificate=True"
},
"SshSettings": {
"Host": "192.168.10.1",

View File

@@ -13,7 +13,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("Inventario.API")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+99d98cc588b3922b6aa3ab9045fcee9cb31de1f3")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+04f1134be432cfc59ba887bba19eb9b563256780")]
[assembly: System.Reflection.AssemblyProductAttribute("Inventario.API")]
[assembly: System.Reflection.AssemblyTitleAttribute("Inventario.API")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]