I have a shiny app within a Docker image that I would like to run and view in my browser. When I run the container I am unable to see the shiny app on localhost:3838 (or 127.0.0.1:3838).
My docker compose:
version: '3.8'
services:
velocity:
build:
context: .
dockerfile: Dockerfile
image: vapp:latest
ports:
- '80:3838'
Then, in the terminal: docker-compose run velocity
which, after running through some r code results in the message:
Listening on http://127.0.0.1:4901
However I am unable to see the app either http://127.0.0.1:4901 or http://127.0.0.1:3838.
In case it's relevant, my Dockerfile:
FROM rocker/shiny:4.0.2
COPY app app
RUN apt-get update \
&& apt-get upgrade -y \
&& R --no-save -f app/install.R
WORKDIR app
CMD R --no-save -f app.R
How can I run the app and then view it in my browser at localhost:3838?