Skip to content

Commit 4ab287c

Browse files
committed
prepare docker image
1 parent 7034e3b commit 4ab287c

File tree

5 files changed

+14
-3
lines changed

5 files changed

+14
-3
lines changed

app/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM python:2-onbuild
2+
EXPOSE 5000
3+
CMD ["gunicorn", "-w 3", "-k gevent", "-b 0.0.0.0:5000", "api:app"]
File renamed without changes.

app/model.pkl

9.61 MB
Binary file not shown.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
from celery import Celery
44

55
# Set up celery
6-
CELERY_BROKER_URL = 'redis://'
7-
CELERY_RESULT_BACKEND = 'redis://'
6+
CELERY_BROKER_URL = 'redis://redis'
7+
CELERY_RESULT_BACKEND = 'redis://redis'
88

99
celery = Celery('predict', broker=CELERY_BROKER_URL,
1010
backend=CELERY_RESULT_BACKEND)
1111
celery.conf.update()
1212

1313
# Load the model
1414
if os.environ.get('CELERY_WORKER'):
15-
model = joblib.load('model/model.pkl')
15+
model = joblib.load('model.pkl')
1616

1717
@celery.task
1818
def predict_text(text):

app/requirements.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
numpy
2+
scipy
3+
scikit-learn
4+
joblib
5+
Flask
6+
gunicorn
7+
celery[redis]
8+
gevent

0 commit comments

Comments
 (0)