Skip to content

Support containerization of client-side webassembly applications #199

@baronfel

Description

@baronfel

Currently users that containerize a standard blazorwasm .NET SDK template end up with something unrunnable - because this style of application is compiled to WASM and then intended to be run from a browser, our defaults are all wrong.

We should detect (or allow the user to tell us) that they want to serve static content and then specify or infer

  • an image to act as an http server
  • the root to serve data from

I was able to make this work today with the busybox image, which includes an http server in it, using the following configuration:

<PropertyGroup>
  <ContainerBaseImage>localhost:5010/library/busybox:1.35</ContainerBaseImage>
</PropertyGroup>

<ItemGroup>
    <ContainerEntrypoint Include="busybox;httpd;-f;-v;-p;80;-h;./wwwroot" />
</ItemGroup>

The main annoyance is that you can't change the working directory directly to wwwroot because we copy the publish contents to the working directory by default, so the relative host directory of the app had to be changed via CLI argument.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Tracking

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions