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.
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
use the below command
docker build --tag blazorstatic .
Run the docker container mapping the port exposed from the container to a port on the host
docker run -p 8080:80 blazorstatic
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