RStudio in ShinyProxy (Container unresponsive)

Hi

I read the comments of this topic (A proxy for RStudio Server like ShinyProxy) - it didn’t help.

I will try to describe my situation:

System:
Windows + WSL2 + Ubuntu 20.04 + Docker Desktop (Expose daemon on tcp: // localhost: 2375 without TLS -> ON)

What has been done and is working:

  1. Created the /opt/R folder

  2. Rstudio

    Created the /opt/R/rstudio folder

    Dockerfile for rstudio:

    FROM rocker/rstudio
    
    RUN install2.r --error --skipinstalled \
        renv
    
    RUN echo "www-frame-origin=same" >> /etc/rstudio/disable_auth_rserver.conf
    

    Now if I write the commands:
    docker build -t rstudio .
    and
    docker run --rm -p 127.0.0.1:8787:8787 -e DISABLE_AUTH = true rstudio

    Then the server (itself, without shinyproxy) starts up!

  3. ShinyProxy

    Created a folder /opt/R/shiny-proxy

    Dockerfile for shinyproxy

    FROM openjdk:11-jre
    
    RUN mkdir -pv /opt/R/shiny-proxy
    RUN cd /opt/R/shiny-proxy && wget https://www.shinyproxy.io/downloads/shinyproxy-2.5.0.jar
    
    EXPOSE 8080
    
    WORKDIR /opt/R/shiny-proxy
    CMD ["java", "-noverify", "-jar", "shinyproxy-2.5.0.jar", "--spring.jmx.enabled=false", "--spring.config.location=./config/application.yml"]
    

    Docker-compose (in /opt/R)

    version: '2'
    
    services:
       shiny-proxy:
          build:
             context: ./shiny-proxy/
          image: shiny-proxy
          container_name: shiny-proxy-1
          restart: on-failure
          environment:
             R_USER_PASSWORD: pass
          volumes:
            - /var/run/docker.sock:/var/run/docker.sock
            - ./shiny-proxy/config:/opt/R/shiny-proxy/config
          ports:
            - "8080:3838"
    

    And I fill in the application.yml file

    server:
       forward-headers-strategy: native
    
    proxy:
      title: "Analyst module"
      template-path: ./templates
      landing-page: /
      heartbeat-rate: 10000
      heartbeat-timeout: 60000
      port: 3838
      authentication: simple
      container-wait-time: 30000
    
    docker:
       internal-networking: true
     
    admin-groups: admin
    
    users:
     - name: ruser
       password: pwd
       groups: admin
    
     specs:
     - id: "SEPARATOR_DEV"
       display-name: "Develop"
       logo-url: "code"
       
     - id: "rstudio"
       access-groups: [admin]
       display-name: "RStudio IDE"
       logo-url: "r project"
       description: "RStudio"
       container-image: rstudio
       port: 8787
       container-volumes: [ "/home/#{proxy.userId}:/home/#{proxy.userId}" ]
       container-env:
         USER: "#{proxy.userId}"
         DISABLE_AUTH: true
         WWW_ROOT_PATH: "#{proxySpec.containerSpecs[0].env.get('SHINYPROXY_PUBLIC_PATH')}"
    
    

    ShinyProxy has started successfully!

    image

    But RStudio doesn’t want to run in it!!!

    shiny-proxy-1  | 2021-09-12 14:38:43.265  WARN 1 --- [  XNIO-1 task-2] e.o.shinyproxy.ShinyProxyTestStrategy    : Container unresponsive, trying again (2/15): http://7428710c6983:8787
    shiny-proxy-1  | 2021-09-12 14:38:45.267  WARN 1 --- [  XNIO-1 task-2] e.o.shinyproxy.ShinyProxyTestStrategy    : Container unresponsive, trying again (3/15): http://7428710c6983:8787
    shiny-proxy-1  | 2021-09-12 14:38:47.268  WARN 1 --- [  XNIO-1 task-2] e.o.shinyproxy.ShinyProxyTestStrategy    : Container unresponsive, trying again (4/15): http://7428710c6983:8787
    shiny-proxy-1  | 2021-09-12 14:38:49.269  WARN 1 --- [  XNIO-1 task-2] e.o.shinyproxy.ShinyProxyTestStrategy    : Container unresponsive, trying again (5/15): http://7428710c6983:8787
    shiny-proxy-1  | 2021-09-12 14:39:01.282  WARN 1 --- [  XNIO-1 task-2] e.o.shinyproxy.ShinyProxyTestStrategy    : Container unresponsive, trying again (6/15): http://7428710c6983:8787
    shiny-proxy-1  | 2021-09-12 14:39:03.283  WARN 1 --- [  XNIO-1 task-2] e.o.shinyproxy.ShinyProxyTestStrategy    : Container unresponsive, trying again (7/15): http://7428710c6983:8787
    shiny-proxy-1  | 2021-09-12 14:39:05.285  WARN 1 --- [  XNIO-1 task-2] e.o.shinyproxy.ShinyProxyTestStrategy    : Container unresponsive, trying again (8/15): http://7428710c6983:8787
    shiny-proxy-1  | 2021-09-12 14:39:07.286  WARN 1 --- [  XNIO-1 task-2] e.o.shinyproxy.ShinyProxyTestStrategy    : Container unresponsive, trying again (9/15): http://7428710c6983:8787
    shiny-proxy-1  | 2021-09-12 14:39:09.287  WARN 1 --- [  XNIO-1 task-2] e.o.shinyproxy.ShinyProxyTestStrategy    : Container unresponsive, trying again (10/15): http://7428710c6983:8787
    

    Question: What do I need to write to make it work?

Hi

When using ShinyProxy with Docker and internal networking, you have to create a dedicated Docker network. See https://github.com/openanalytics/shinyproxy-config-examples/tree/master/02-containerized-docker-engine
Make sure to edit your application.yml file to include the container-network: sp-example-net option for every app (see the repo).

Creating your own docker-network didn’t help.

Solved the problem with colleagues. We created an .env-file, wrote the COMPOSE_PROJECT_NAME=test variable to it

Further in the docker-compose indicated: SHINY_PROXY_DOCKER_NETWORK: ${COMPOSE_PROJECT_NAME}_default

And in application.yml after port: 8787:
container-network: ${SHINY_PROXY_DOCKER_NETWORK}

1 Like