Skip to content

Instantly share code, notes, and snippets.

@atzimler
Created April 18, 2022 20:50
Show Gist options
  • Save atzimler/41b605d1f16c5556fad22983d6df2712 to your computer and use it in GitHub Desktop.
Save atzimler/41b605d1f16c5556fad22983d6df2712 to your computer and use it in GitHub Desktop.
.NET Blazor WebASM Example Docker Container
FROM debian:latest
RUN apt-get update
RUN apt-get install -y wget openssh-server mc
RUN wget https://packages.microsoft.com/config/debian/11/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
RUN dpkg -i packages-microsoft-prod.deb
RUN rm packages-microsoft-prod.deb
RUN apt-get update
RUN apt-get install -y apt-transport-https
RUN apt-get update
RUN apt-get install -y dotnet-sdk-6.0
ADD run.sh /run.sh
RUN chmod +x /*.sh
RUN mkdir -p /var/run/sshd
RUN mkdir x
RUN cd /x && dotnet new blazorwasm
RUN cd /x && dotnet build
RUN cd x/Properties \
&& cat launchSettings.json \
| sed -e 's%.*applicationUrl.*%"applicationUrl": "http://*:9999",%' \
> new.json \
&& mv -f new.json launchSettings.json
EXPOSE 9999
CMD ["/run.sh"]
# run.sh is:
#! /bin/bash
#set -e
#cd /x
#dotnet run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment