Shiny for Python app fails to load


I try to run a Shiny for Python app on ShinyProxy 2.6.1.

While the Docker container works fine locally (and when run on the server directly as well), I just get a “Container did not respond in time” on ShinyProxy.

The Dockerfile, I use to create the image is


USER docker
WORKDIR /home/docker 
COPY requirements.txt /home/docker
RUN pip3 install --no-cache-dir --upgrade -r requirements.txt
RUN pip3 install gunicorn
COPY . /home/docker
CMD ["gunicorn", "app:app", "--bind", "", "-k", "uvicorn.workers.UvicornWorker"]

and the app configuration for ShinyProxy looks like:

  - id: pyshiny-demo
    container-image: <REGISTRY>/shinyproxy-pyshiny-airmass
    port: 8080
      SCRIPT_NAME: "#{proxy.getRuntimeValue('SHINYPROXY_PUBLIC_PATH').replaceFirst('/$','')}"
    target-path: "#{proxy.getRuntimeValue('SHINYPROXY_PUBLIC_PATH')}"

Using uvicorn as recommended in the docs didn’t work either.

Any idea how to debug further?


We tested Shiny For Python in ShinyProxy and this is working for us. You can see the demo code here: .
I think that the main difference with your setup is that we didn’t add the SCRIPT_NAME and target-path settings.

Can you let us know whether your app works with the above demo code?

Thanks for the example, that works fine from e. But unfortunately I get a “Unsupported upgrade request.” from the airmass app still. Other apps working though, so not sure what actually causes that particular issue.
Thanks again for helping!

That’s weird, this app is working fine for me.
I’m using this Dockerfile:

FROM python:3.10



COPY . .

RUN pip3 install gunicorn
RUN pip3 install -r

CMD ["gunicorn", "app:app", "--bind", "", "-k", "uvicorn.workers.UvicornWorker"]

Note that I had to install the dependencies from the file, since it seems a wrong Shiny version is pinned in the requirements.txt file (and python would give an error at startup).

I pushed this image to Docker hub using ledfan/airmass, can you test the following config:

  title: Open Analytics Shiny Proxy
  landing-page: /
  heartbeat-rate: 10000
  heartbeat-timeout: 60000
  port: 8080
  authentication: simple
  admin-groups: scientists
  - name: jack
    password: password
    groups: scientists
  - name: jeff
    password: password
    groups: mathematicians
  - id: pyshiny-demo
    container-image: ledfan/airmass
    port: 8080

Finally, I see that this example is downloading a file from the internet, maybe this fails? Can you check the logs of the container when it fails, e.g. using docker ps -a, docker logs -f <id>