Skip to content

Commit

Permalink
upgraded flask version, change spacy model to md
Browse files Browse the repository at this point in the history
  • Loading branch information
alfredfrancis committed Jul 21, 2021
1 parent d3da249 commit 4db4b9b
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Expand Up @@ -9,7 +9,7 @@ WORKDIR /usr/src/app
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt

RUN python -m spacy download en; python
RUN python -m spacy download en_core_web_md; python

EXPOSE 8080

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
@@ -1,5 +1,5 @@

Flask==2.0.1
Flask==1.1.2
flask-mongoengine==0.9.5
Flask-Script==2.0.6
Flask-Cors==3.0.3
Expand Down
29 changes: 29 additions & 0 deletions ~
@@ -0,0 +1,29 @@
setup: venv/bin/activate

venv/bin/activate:
. test -d venv || virtualenv -p python3 venv
. venv/bin/activate; pip install -Ur requirements.txt
. venv/bin/activate; python manage.py install_nltk_dependencies
. venv/bin/activate; python -m spacy download en_core_web_md && python -m spacy link en_core_web_md en

restore_db:
mongorestore --drop --db=iky-ai --dir=dump/iky-ai/

init: restore_db setup
. venv/bin/activate && python setup.py

setup_spacy:
. venv/bin/activate && python -m spacy download en_core_web_md && python -m spacy link en_core_web_md en

run_dev:
. venv/bin/activate && python run.py

run_prod:
. venv/bin/activate && APPLICATION_ENV="Production" gunicorn -k gevent --bind 0.0.0.0:8080 run:app

run_docker:
gunicorn run:app --bind 0.0.0.0:8080 --access-logfile=logs/gunicorn-access.log --error-logfile logs/gunicorn-error.log

clean:
rm -rf venv
find -iname "*.pyc" -delete

0 comments on commit 4db4b9b

Please sign in to comment.