Unable to access plumber API from my Docker Container.

I am currently unable to access swagger docs and API endpoints from my docker container. My dockerfile is as below. Kindly assist.

"FROM rstudio/plumber

MAINTAINER Kennedy

RUN apt-get update -qq &&
apt-get install -y
libssl-dev
libcurl4-gnutls-dev
unixodbc-dev
libmysqlclient-dev

RUN mkdir /data

COPY plumber.R /data
WORKDIR /data

EXPOSE 8000

RUN R -e "install.packages(c('plumber', 'dplyr', 'ggplot2','plotly', 'odbc', 'kableExtra', 'shinyWidgets', 'lubridate', 'DT', 'shinyWidgets', 'tidyr', 'rapidoc'), dependencies = TRUE)"

ENTRYPOINT ["R", "-e", "plumber::plumb('/data/plumber.R')$run(port = 8000, swagger = TRUE)"]"

ENTRYPOINT ["R", "-e", "plumber::plumb('/data/plumber.R')$run(host = 0.0.0.0, port = 8000)"]"

Specify the host to be 0.0.0.0.

2 Likes

Thank you. This has worked for me.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.