0

I have created a Docker image (R-Shiny) and tested it on my PC (Windows10) - via localhost. Everything works great.

But as soon as I load and host my Docker image on my server (Ubuntu) (via Shinyproxy and nginx) I get the error message

"Error
Status code: 500
Message: Container did not respond in time".

What could be the reason that the Docker image works on the PC but not via the public IP of the server?

The Shinyproxy "sample application" works well. You can test it yourself on foundyoung.de Please keep in mind, that this is just a test enviroment. ;)

Thanks and kind regards


Added some details:

Dockerfile:

FROM rocker/r-base:latest
LABEL maintainer="USER <user@example.com>"
RUN apt-get update && apt-get install -y --no-install-recommends \
    sudo \
    libcurl4-gnutls-dev \
    libgtk2.0-dev\
    libjq-dev\
    xvfb\
    xauth\
    xfonts-base\
    libcairo2-dev \
    libxt-dev \
    libssl-dev \
    libssh2-1-dev \
    libxml2-dev \
    libmagick++-dev\
    openjdk-8-jre-headless\
    openjdk-8-jdk\
    && R CMD javareconf\
        && rm -rf /var/lib/apt/lists/*

RUN sed -i 's/name="disk" value="1GiB"/name="disk" value="8GiB"/' /etc/ImageMagick-6/policy.xml 


#r-cran-rjava\

RUN install.r shiny
RUN echo "local(options(shiny.port = 3838, shiny.host = '0.0.0.0'))" > /usr/lib/R/etc/Rprofile.site
RUN addgroup --system app \
    && adduser --system --ingroup app app
WORKDIR /home/app
COPY app .
RUN Rscript installPackages.R

RUN chown app:app -R /home/app
USER app
EXPOSE 3838
CMD ["R", "-e", "shiny::runApp('/home/app')"]

application.yml

proxy:
  title: ShinyProxy
#  logo-url: https://link/to/your/logo.png
  landing-page: /
  favicon-path: favicon.ico
  heartbeat-rate: 10000
  heartbeat-timeout: 600000
  port: 8080
  # Example: 'simple' authentication configuration
  # Docker configuration
  docker:
    cert-path: /home/none
    url: http://localhost:2375
    port-range-start: 20000
  specs:
  - id: 01_hello
    display-name: Hello Shiny App
    description: A simple reactive histogram
    container-cmd: ["R", "-e", "shiny::runApp('/home/app')"]
    container-image: registry.gitlab.com/analythium/shinyproxy-hello/hello:latest
    logo-url: https://github.com/analythium/shinyproxy-1-click/raw/master/digitalocean/images/app-hist.png
  - id: 02_hello
    display-name: Demo Shiny App
    description: App with sliders and large file upload
    container-cmd: ["R", "-e", "shiny::runApp('/home/app')"]
    container-image: 2007199809022014/container1:container1
    logo-url: https://github.com/analythium/shinyproxy-1-click/raw/master/digitalocean/images/app-dots.png

logging:
  file:
    name: shinyproxy.log

spring:
  servlet:
    multipart:
      max-file-size: 200MB

enter image description here

Server running on Ubuntu 20.04 My PC (where the Docker image is working fine): Windows10, docker testing via localhost:4000) Docker Version: 20.10.7 Open Ports: 22, 80, 443, 9000, 80, 8080, 4000

If u need anything more, just ask!

LePyka
  • 181
  • 8
  • @Aurèle that was a copy-paste-error, i fixed it and added a screenshot. Thanks! – LePyka Nov 29 '21 at 13:29
  • What does `docker images -q 2007199809022014/container1:container1` return on the server, i.e. is it found? – Aurèle Nov 29 '21 at 13:55
  • @Aurèle it is found. The command returns "7b42e6526f2e", which is the Image ID. – LePyka Nov 29 '21 at 13:56
  • You could look at the logs (not `shinyproxy.log`, but the individual containers logs. They can be configured with `container-log-path: ...`, but if I recall correctly they can also be found directly within the running shinyproxy container, by attaching a tty to it). Or try a `docker run -p 3838:3838 2007199809022014/container1:container1 R -e "shiny::runApp('/home/app')"` as suggested in https://www.shinyproxy.io/faq/ . – Aurèle Nov 29 '21 at 14:18
  • Somehow the logs are not generated. The Docker run-command does not throw a error - everthings seems to be working.. except, its just not working – LePyka Nov 29 '21 at 14:58
  • Then I'd say next step is to configure the container logs, relaunch Shinyproxy, and look at the log of a failed app. – Aurèle Nov 29 '21 at 15:31
  • Have you tried running `docker logs CONTAINER`? I believe this command (or a similar command for docker swarm) was what I used to see what was causing problems starting up a container. – Adam Sampson Dec 02 '21 at 02:23
  • Also, is there any other service that might be using port 8080? Is port 8080 being limited by your firewall? – Adam Sampson Dec 02 '21 at 02:26

0 Answers0