Comments (7)
docker available at https://hub.docker.com/r/dselivanov/restrserve/
from restrserve.
@d3an that looks like an ordinal example of RestRserve docker image, but not a RestRserve paired with HAproxy. As for standard RestRserve base docker images I suggest "official" one - https://hub.docker.com/repository/docker/rexyai/restrserve (and corresponding Dockerfile)
from restrserve.
To make things simpler
from restrserve.
Link points to a 404 error page. It doesn't exist i guess
from restrserve.
@vikram-rawat please refer to the readme - https://restrserve.org/#docker as the source of truth.
from restrserve.
I got a PoC working with this:
Dockerfile
FROM rocker/r-base:latest
RUN mkdir -p /app
COPY . /app
RUN Rscript /app/install_packages.R
CMD Rscript /app/server.R
app/install_packages.R
install.packages("RestRserve", repos = "https://cloud.r-project.org")
install.packages("readr")
app/server.R
library(RestRserve)
app = Application$new()
app$add_get(
path = "/health",
FUN = function(.req, .res) {
.res$set_body("OK")
})
app$add_post(
path = "/addone",
FUN = function(.req, .res) {
result = list(x = .req$body$x + 1L)
.res$set_content_type("application/json")
.res$set_body(result)
})
backend = BackendRserve$new()
backend$start(app, http_port = 8080)
Build Steps
$ docker pull rocker/r-base
$ docker build -t username/image_name . # build time took like 10mins tho
$ docker run --rm -it -p 8080:8080 username/image_name
Testing
$ curl http://localhost:8080/health
OK
$ curl -X POST -H "Content-Type: application/json" -d '{"x":4}' http://localhost:8080/addone
{"x":5}
from restrserve.
Hi @dselivanov is there a reason you removed HAproxy from the base docker? Is it no longer recommended or was that to just make things simpler?
from restrserve.
Related Issues (20)
- [BUG] POST request with content-type "application/x-www-form-urlencoded" failed HOT 1
- Question: content type zip / binary -> application/zip, application/octet-stream HOT 1
- Automated docker hub builds don't work anymore HOT 2
- Header Content is split on Comma HOT 7
- Example available with post request with json in, json out? HOT 2
- cannot use source or eval in Rserve.conf or in backend$start as additional args HOT 5
- [BUG] segfault when running umap in RestRserve endpoint HOT 4
- MacOS: "+[NSNumber initialize] may have been in progress in another thread when fork() was called." HOT 3
- serving static files HOT 5
- [BUG] slow to serve static file and swagger UI must use CDN
- [BUG] Rserve version wrong in description file
- Missing CORS response headers to some browsers' pre-flight checks? HOT 2
- Error when transfer is cancelled, leading to tempdir deletion HOT 7
- [BUG] "discarding buffer because too big" in ssl example HOT 2
- [BUG] to_json different form toJSON in jsonlite
- error creating database (mongolite) connection in handler HOT 4
- Sending emails hangs when using RestRserve instead of plumber HOT 3
- Not all errors are caught when processing requests HOT 2
- Background process doesn't kill correctly the childs HOT 1
- CI fails with segfault
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from restrserve.