Skip to content

Commit 020a219

Browse files
committed
update
1 parent ddcc737 commit 020a219

File tree

4 files changed

+27
-11
lines changed

4 files changed

+27
-11
lines changed

.dockerignore

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ Dockerfile
55
README.md
66
CODE_OF_CONDUCT.md
77
LICENSE
8-
env.*
9-
devops
8+
__pycache__
9+
.vscode
10+
Procfile

Dockerfile

+22-9
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,35 @@
11
FROM ubuntu:18.04
2-
MAINTAINER Wonhee Jung "[email protected]"
2+
ENV TERM xterm
3+
ENV LC_ALL C.UTF-8
4+
ENV FLASK_APP webapp.py
5+
LABEL maintainer="Wonhee Jung([email protected])"
6+
37
RUN apt-get update && apt-get install -y \
48
software-properties-common
59
RUN add-apt-repository universe
610
RUN apt-get update && apt-get install -y \
711
curl \
812
git \
913
python3.6 \
10-
python3-pip
11-
COPY . /app
14+
python3-pip && \
15+
rm -rf /var/lib/apt/lists/*
16+
17+
COPY requirements.txt /requirements.txt
18+
19+
RUN pip3 install --upgrade pip
20+
RUN pip3 install -r requirements.txt && \
21+
pip freeze
22+
1223
WORKDIR /app
13-
RUN pip3 install -U nltk
24+
EXPOSE 5000
25+
26+
COPY . /app
27+
28+
1429
RUN python3 -m nltk.downloader popular
15-
RUN pip3 install -U numpy
16-
RUN pip3 install -r requirements.txt
30+
1731
# prepare classifier and vectorizer so webapp will start up faster
1832
RUN python3 ./detox_engine.py
19-
ENTRYPOINT ["python3"]
20-
CMD ["webapp.py"]
33+
ENTRYPOINT ["python3", "-u"]
34+
CMD ["/app/webapp.py"]
2135

22-
EXPOSE 5000

detox_engine.py

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import numpy as np
1818
import pandas as pd
1919
from joblib import dump, load
20+
from nltk import word_tokenize,sent_tokenize
2021
from nltk.stem import WordNetLemmatizer
2122
from sklearn.feature_extraction.text import TfidfVectorizer
2223
from sklearn.naive_bayes import MultinomialNB

requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ pandas
44
joblib
55
sklearn
66
gevent
7+
gevent-websocket
78
flask
89
flask_socketio
910
flask_sockets

0 commit comments

Comments
 (0)