diff --git a/reader/Dockerfile b/reader/Dockerfile new file mode 100644 index 0000000..928e4db --- /dev/null +++ b/reader/Dockerfile @@ -0,0 +1,16 @@ +FROM python:3.5 + +RUN python -m pip install pip==9.0.3 +RUN pip install flask-ask +RUN pip install cryptography==2.1.4 +RUN apt-get update +RUN apt-get install -y gcc libevent-dev python-dev + +RUN pip install --upgrade pip +COPY ./requirements.txt / +RUN pip install -r /requirements.txt +COPY ./ /app +RUN python /app/nltkDown.py +WORKDIR /app +EXPOSE 5000 +CMD ["gunicorn", "-b", "0.0.0.0:5000", "app"] \ No newline at end of file diff --git a/reader/app.py b/reader/app.py index 14ac79d..c69bcdf 100644 --- a/reader/app.py +++ b/reader/app.py @@ -8,8 +8,8 @@ from textblob_de import TextBlobDE as TextBlob import siteobj as site2 import util -app = Flask(__name__) -ask = Ask(app, "/") +application = Flask(__name__) +ask = Ask(application, "/") logging.getLogger('flask_ask').setLevel(logging.DEBUG) ### ### @@ -200,6 +200,6 @@ if __name__ == '__main__': if 'ASK_VERIFY_REQUESTS' in os.environ: verify = str(os.environ.get('ASK_VERIFY_REQUESTS', '')).lower() if verify == 'false': - app.config['ASK_VERIFY_REQUESTS'] = False + application.config['ASK_VERIFY_REQUESTS'] = False - app.run(host='127.0.0.1',port=5000) + application.run(host='127.0.0.1',port=80) diff --git a/reader/nltkDown.py b/reader/nltkDown.py new file mode 100644 index 0000000..dcefba5 --- /dev/null +++ b/reader/nltkDown.py @@ -0,0 +1,2 @@ +import nltk +nltk.download('punkt') \ No newline at end of file diff --git a/reader/requirements.txt b/reader/requirements.txt new file mode 100644 index 0000000..1682505 --- /dev/null +++ b/reader/requirements.txt @@ -0,0 +1,7 @@ +requests +flask +lxml +gunicorn +numpy +nltk +textblob-de \ No newline at end of file