Replies: 1 comment 2 replies
-
Hey, thanks for the supportive words. As I don't use the Blog with a docker container, let us figure this one out together. Regarding nginx and Blazor, I can only refer to this article, as I don't use a reverse proxy in between. Here a rough sketch for a dockerfile you could use: 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/LinkDotNet.Blog.Web
COPY ["LinkDotNet.Blog.Web.csproj", "."]
RUN dotnet restore "LinkDotNet.Blog.Web.csproj"
COPY . .
RUN dotnet build "LinkDotNet.Blog.Web.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "LinkDotNet.Blog.Web.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "LinkDotNet.Blog.Web.dll"] Then you should be able to create the container via: docker build -t LinkDotNet.Blog.Web . For this to work you would still need a storage provider somewhere (SQL, RavenDb, ...). You could also use an image where there is already an SQL instance available. |
Beta Was this translation helpful? Give feedback.
-
Hello, I really like the layout of this Blog website, and its features are comprehensive enough to meet my needs.
Personally, I have worked with C# but not with ASP.NET, and Blazor's framework is very complex to me.
Local testing went smoothly, but I encountered some trouble with https when deploying to the server.
I have used Google to search for answers to the problem, but it seems that there is no good answer.
If I use nginx reverse proxy for https, Blazor will try to redirect https, but if only http is used, the authorization part will not be able to log in.
How should I deploy it, if possible using docker would be even better.
Beta Was this translation helpful? Give feedback.
All reactions