Moving Dockerfile to the root

This commit is contained in:
James Tombleson 2023-06-15 21:50:36 -07:00
parent 8c7a5e65fb
commit d6ab6fa402
3 changed files with 24 additions and 1 deletions

3
.dockerignore Normal file
View File

@ -0,0 +1,3 @@
appsettings.json
**/bin/
**/obj/

20
Dockerfile Normal file
View File

@ -0,0 +1,20 @@
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
WORKDIR /src
COPY ["Newsbot.Portal.Blazor.Server/Newsbot.Portal.Blazor.Server.csproj", "Newsbot.Portal.Blazor.Server/"]
RUN dotnet restore "Newsbot.Portal.Blazor.Server/Newsbot.Portal.Blazor.Server.csproj"
COPY . .
WORKDIR "/src/Newsbot.Portal.Blazor.Server"
RUN dotnet build "Newsbot.Portal.Blazor.Server.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "Newsbot.Portal.Blazor.Server.csproj" -c Release -o /app/publish /p:UseAppHost=false
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Newsbot.Portal.Blazor.Server.dll"]

View File

@ -2,6 +2,6 @@ namespace Newsbot.Portal.Blazor.Server;
public static class Global
{
public static HttpClient HttpClient { get; set; }
public static HttpClient? HttpClient { get; set; }
public static string? DefaultInstanceUri { get; set; }
}