jgontrum / spacy-api-docker

spaCy REST API, wrapped in a Docker container.
https://hub.docker.com/r/jgontrum/spacyapi/
MIT License
265 stars 99 forks source link

No output for curl command #11

Closed prabuddhg closed 6 years ago

prabuddhg commented 6 years ago

Hi All,

I cloned the repo and ran the cli:

Prabuddhs-MacBook-Air:spacy-api-docker pg$ docker run -p "127.0.0.1:8080:80" jgontrum/spacyapi:en /usr/lib/python2.7/dist-packages/supervisor/options.py:296: UserWarning: Supervisord is running as root and it is searching for its configuration file in default locations (including its current working directory); you probably want to specify a "-c" argument specifying an absolute path to a configuration file for improved security. 'Supervisord is running as root and it is searching ' 2017-10-20 15:46:48,043 CRIT Supervisor running as root (no user in config file) 2017-10-20 15:46:48,043 WARN Included extra file "/etc/supervisor/conf.d/supervisor.conf" during parsing 2017-10-20 15:46:48,070 INFO RPC interface 'supervisor' initialized 2017-10-20 15:46:48,070 CRIT Server 'unix_http_server' running without any HTTP authentication checking 2017-10-20 15:46:48,072 INFO supervisord started with pid 1 2017-10-20 15:46:49,081 INFO spawned: 'nginx' with pid 7 2017-10-20 15:46:49,087 INFO spawned: 'api' with pid 8 2017-10-20 15:46:49,093 INFO spawned: 'frontend' with pid 9 2017-10-20 15:46:50,149 INFO success: nginx entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2017-10-20 15:46:50,150 INFO success: api entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2017-10-20 15:46:50,150 INFO success: frontend entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

when I run the curl command: curl -s localhost:8000/ent -d '{"text":"Pastafarians are smarter than people with Coca Cola bottles.", "model":"en"}'

I dont get any output.

jgontrum commented 6 years ago

Did you maybe use the wrong port? You call localhost:8000 instead of localhost:8080. Also, could you try to specify the content type in the curl request as JSON?

prabuddhg commented 6 years ago

Oops sorry 8080 it is!

prabuddhg commented 6 years ago

Thanks for responding :-)