dev-resources.site
for different kinds of informations.
Steps for Deploying a Blazor as Static Site with Docker and Nginx
Published at
6/11/2020
Categories
blazor
hosting
standalone
nginx
Author
gopkumr
Author
7 person written this
gopkumr
open
Step 1 Publish the Blazor WebAssembly project
Publish the project from Visual Studio,this ensures that the projects is linked which removes all the unwanted dependencies from the output, reducing the size of the assemblies created.
Step 2 Create a dockerfile
The docker file is very straightforward, pull the nginx image and copy the published Blazor WebAssembly file from the WWWRoot folder to the html folder in nginx
FROM nginx:alpine
EXPOSE 80
COPY bin/Release/netcoreapp3.1/publish/wwwroot /usr/share/nginx/html
Step 3 Build the docker image
use the below command
docker build --tag blazorstatic .
Step 4 Run the docker container
Run the docker container mapping the port exposed from the container to a port on the host
docker run -p 8080:80 blazorstatic
Step 5 Access the Blazor WebApp from browser
Access the URL https://localhost:8080 which loads the WebApp
Source code for both ASPNet hosting and Static Website Hosting is available in Github: https://github.com/gopkumr/BlazorTourOfHeroes.git
Branch: Perf
standalone Article's
9 articles in total
What Are Standalone Components Angular 17 ?
read article
Configuring Firebase with Angular standalone component
read article
How to Use Helm Chart to Deploy Standalone GreptimeDB on Kubernetes
read article
Angular testing
read article
How to use ChatGPT in Git Bash Terminal as a Standalone
read article
Microgateway Stand-alone Kubernetes Sidecar Deployment
read article
Undestanding Java OSGI framework
read article
Steps for Deploying a Blazor as Static Site with Docker and Nginx
currently reading
FEATool Multiphysics - Stand-Alone PDE and Physics Simulation Toolbox
read article
Featured ones: