I am trying to deploy a Blazor Server side application to the Google Cloud App Engine.
I have the base project that build when you select the Blazor Server App with docker enable for Linux, and put the following app.yaml in the project folder:
runtime: custom
env: flex
I then opened my gcloud console to this directory and did an app deploy, however this failed on step 7 in the boilerplate dockerfile. I noticed that the dockerfile had all of the project relevant files in a nested directory of the project name, so I removed the first folder from each of the docker commands:
#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/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["CallAssistant.csproj", "."]
RUN dotnet restore "CallAssistant.csproj"
COPY . .
RUN dotnet build "CallAssistant.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "CallAssistant.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "CallAssistant.dll"]
After this, I ran another gcloud app deploy and the deployment process completed, and on the google cloud console I was able to see the service running. However, when I tried to access the server I got a 502 Bad Gateway error on the home page, and subsequently in each of the nav pages nested in the app.
Does anyone know how to deploy a Blazor app to google app engine utilizing the docker image?