I work on a windows laptop and want to host an API of mine that I made in R (using plumber package) using docker desktop for windows.
The tutorial found here gives an example of running a pre-installed plumber code using this command: docker run --rm -p 8000:8000 rstudio/plumber
. This hosts the API that is present in the given location: "C:\Users\sidmh\Documents\R\win-library\4.0\plumber\examples\04-mean-sum\plumber.R"
However, I want to host an API present in this location: "C:\Users\sidmh\Documents\Nutri\plumber.R"
How can I do this?
Hosting an R plumber API using docker
1.8k views Asked by Siddhanta Mhambrey At
1
You will need to adapt (from the
plumber
documentation) theDockerfile
to get your custommy_plumber_api.R
script stored in the 'app' folder with something along :Dockerfile
Then you will need to build (and tag for convenience) the docker image before being able to run it with :
You should check the Docker documentation for specifics (choose the exposed port, ...).