-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from Surt/master
+ added docker image with supervisord
- Loading branch information
Showing
4 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Use the official image as a parent image. | ||
FROM python:3.8.5-slim-buster | ||
|
||
RUN apt-get update && \ | ||
apt-get upgrade -y && \ | ||
apt-get install -y git && \ | ||
apt-get install -y supervisor | ||
|
||
# Set the working directory. | ||
WORKDIR /usr/src | ||
RUN git clone https://github.com/web64/nlpserver.git | ||
WORKDIR /usr/src/nlpserver | ||
|
||
# Install dependencies | ||
RUN apt-get -y install pkg-config && \ | ||
apt-get -y install -y python-numpy libicu-dev && \ | ||
apt-get -y install -y python3-pip && \ | ||
python3 -m pip install -r requirements.txt | ||
|
||
# Download language models | ||
RUN polyglot download LANG:en | ||
|
||
RUN python3 -m spacy download en && \ | ||
python3 -m spacy download xx | ||
|
||
# Set supervisor config | ||
COPY nlpserver.conf /etc/supervisor/conf.d | ||
COPY entrypoint.sh /usr/local/bin/ | ||
RUN chmod +x /usr/local/bin/entrypoint.sh | ||
|
||
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] | ||
|
||
EXPOSE 6400 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# NLP Server Docker image | ||
|
||
Docker slim image with NLP Server | ||
|
||
## Image creation | ||
|
||
Inside the docker folder run | ||
``` | ||
docker build . --tag nlpserver:1.0 | ||
docker run --publish 6400:6400 --detach --name nlpserver nlpserver:1.0 | ||
``` | ||
|
||
For CoreNLP on another container run: | ||
``` | ||
docker run -p 9000:9000 nlpbox/corenlp | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
/usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf | ||
supervisorctl reread | ||
supervisorctl update | ||
supervisorctl start nlpserver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[program:nlpserver] | ||
command=python3 /usr/src/nlpserver/nlpserver.py | ||
directory=/usr/src/nlpserver/ | ||
autostart=true | ||
autorestart=unexpected | ||
stdout_logfile=/var/log/nlpserver.log | ||
stderr_logfile=/var/log/nlpserver-error.log |