https://github.com/safwanshamsir99/docker-deployment-restapi-using-r
Learning repositories for deployment of R functions as a RESTful API using Docker
https://github.com/safwanshamsir99/docker-deployment-restapi-using-r
dockerfile plumber-api r rest-api
Last synced: 11 months ago
JSON representation
Learning repositories for deployment of R functions as a RESTful API using Docker
- Host: GitHub
- URL: https://github.com/safwanshamsir99/docker-deployment-restapi-using-r
- Owner: safwanshamsir99
- License: mit
- Created: 2024-11-18T10:05:43.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-18T10:22:56.000Z (over 1 year ago)
- Last Synced: 2025-07-04T11:06:10.279Z (12 months ago)
- Topics: dockerfile, plumber-api, r, rest-api
- Language: R
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Getting Started
- Learning repository for the deployment of R functions as a RESTful API using Docker.
# Development
## Run API Locally
```
> plumber::plumb(file='app/plumber.R')$run()
```
## File Tree
```
├── Dockerfile
├── README.md
├── app
│ └── plumber.R
├── tests/testthat/
│ └── test-backend_test.R
└── functions.R
```
### Files Details
1. `Dockerfile` - Docker file for Docker image building in docker.
2. `app/plumber.R` - REST API endpoint to be deployed as an R functions from `functions.R` using Docker.
3. `tests/testthat/test-backend_test.R` - Unit testing for `functions.R`
4. `functions.R` - Simple functions using R programming language.
# Testing
## Run all tests (make sure you are in the parent directory)
```
# RStudio Console
> testthat::test_file("tests/testthat/test-backend_test.R")
```
## Container
1. Build a Docker container locally
```bash
docker build -t rake .
```
2. Run the container locally
```bash
docker run -p 8000:8000 rake
```
3. Copy and paste the URL in your browser to open the Swagger UI.