override port

This commit is contained in:
Chika 2021-05-17 11:10:28 +03:00
parent 8c517cb574
commit 563013e124
3 changed files with 6 additions and 23 deletions

View File

@ -1,21 +0,0 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
WORKDIR /app
EXPOSE 80
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
WORKDIR /src
COPY ["ELT/ELT.csproj", "ELT/"]
RUN dotnet restore "ELT/ELT.csproj"
COPY . .
WORKDIR "/src/ELT"
RUN dotnet build "ELT.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "ELT.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "ELT.dll"]

View File

@ -13,7 +13,11 @@ namespace ELT
public static IHostBuilder CreateHostBuilder(string[] args) public static IHostBuilder CreateHostBuilder(string[] args)
{ {
return Host.CreateDefaultBuilder(args) return Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup<Startup>(); }); .ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
webBuilder.UseKestrel(options => { options.ListenAnyIP(2121); });
});
} }
} }
} }

View File

@ -26,7 +26,7 @@
"eltPassword": "evo12345", "eltPassword": "evo12345",
"eltLogin": "dmitrienko" "eltLogin": "dmitrienko"
}, },
"applicationUrl": "http://localhost:5000" "applicationUrl": "http://localhost:2121"
}, },
"Docker": { "Docker": {
"commandName": "Docker", "commandName": "Docker",