Created
April 18, 2022 20:50
-
-
Save atzimler/41b605d1f16c5556fad22983d6df2712 to your computer and use it in GitHub Desktop.
.NET Blazor WebASM Example Docker Container
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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