Hello !
I have some R plumber files working using RStudio, next step is via docker.
The instruction
source('R/to_run_api_shirin_docker.R')
Starting server to listen on port 8000
don't work and gives the following run :
$ docker run -p 8000:8000 plumber_demo:v4
R version 3.6.3 (2020-02-29) -- "Holding the Windsock"
Copyright (C) 2020 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> source('R/to_run_api_shirin_docker.R')
Starting server to listen on port 8000
Symptoms :
- when run in RStudio I should see for logs :
Starting server to listen on port 8000
Running the swagger UI at http://127.0.0.1:8000/__swagger__/
System time: 2020-07-22 16:50:21
Request method: GET /__swagger__/
HTTP user agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) enter code hereQtWebEngine/5.12.8 Chrome/69.0.3497.128 Safari/537.36 @ 127.0.0.1
System time: 2020-07-22 16:50:21
Request method: GET /swagger.json
HTTP user agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.12.8 Chrome/69.0.3497.128 Safari/537.36 @ 127.0.0.1
and there is nothing at
- http://127.0.0.1:8000/swagger/,
- http://127.0.0.1:8000,
- http://localhost:8000/ swagger / ,
- http://localhost:8000
--- scripts bellow ---
Dockerfile
FROM rocker/r-ver:3.6.3
RUN R -e 'install.packages("plumber")'
RUN R -e 'install.packages("randomForest")'
COPY mod_prod_rf.rds data/
COPY plumber_api_shirin_docker.R /R/
COPY to_run_api_shirin_docker.R /R/
CMD ["R", "-e source('R/to_run_api_shirin_docker.R')"]
R/to_run_api_shirin_docker.R
# --- launch API ----
plumb_path <- "R/plumber_api_shirin_docker.R"
r <- plumber::plumb(plumb_path)
r$run(host = "127.0.0.1", port = 8000)
Thanks in advance for any help !