-
-
Notifications
You must be signed in to change notification settings - Fork 3
Deploying services
This app uses a number of external microservices for PDF parsing.
Steps to use this:
-
Build the docker image
docker build -t figures .
and tag it:docker image tag figures dluan/figures:0.0.5
-
Run the image to start the sinatra web host
docker run -p 4567:4567 dluan/figures:0.0.5
Or if running on an external instance, forward port 80. e.g.
docker run -t --init --rm -p 80:4567 dluan/figures:0.0.5
for figures
docker run -t --rm --init -p 80:8070 lfoppiano/grobid:0.6.1
for grobid
- Once it's running you can post to it like so:
curl localhost:4567/process -X POST -H "Content-Type: application/json" -d '{"pdf": "https://storage.googleapis.com/jellyposter-store/d5058c6990e36d68068ad98422372b6b.pdf", "upload_id": "1"}'
Sometimes Grobid may die and end up turning the service into a zombie, in which case you'll need to stop and restart it (e.g. if using GCE), and then restart the docker Grobid image.
You can easily set up an instance there, make sure to use enough RAM (see Grobid guidelines in Docker section). Give it an external IP, and that address will be set in the Jelly environment variable as GROBID_HOST
. Be sure to set it to http
, and not https
.