Running a asp dotnet core app is very similar to running a flask application. There are a few things that need to be considered:
- You must use the enviorment variable
SCRIPT_NAME
provided by shinyproxy as the path base and use routing. - Links in the web app may not work correctly unless the base path is acounted for, this can be done with the
@Url.Page
helper.
ShinyProxy is an open source application proxy for Shiny Apps (and other apps). It is based on ContainerProxy. Both of which are write by openanalytics.
The Dockerfile in this repo is provided as a minimal example.
The docker image can be built in the root of the repository with this command
docker build -t "shinyproxy-aspnet-core-demo" .
The app can be run and tested locally with
docker run -p 8080:8080 shinyproxy-aspnet-core-demo
Note: It's mentioned that ShinyProxy 2.6.0 is needed in order to run Flask apps (likely due to target-path
). I suspect this is the same for dotnet apps but, have not tested this myself.
A full configuration can be found in application.yml. Example ShinyProxy app configuration:
specs:
- id: flask-demo
container-image: openanalytics/shinyproxy-flask-demo
port: 8080
container-env:
SCRIPT_NAME: "#{proxy.getRuntimeValue('SHINYPROXY_PUBLIC_PATH').replaceFirst('/$','')}"
target-path: "#{proxy.getRuntimeValue('SHINYPROXY_PUBLIC_PATH')}"