diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..76f28a8 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +draft.toml +charts/ +NOTICE +LICENSE +README.md diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2ecaeba --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM python:onbuild +ENV PORT 5000 +EXPOSE 5000 +ENTRYPOINT ["python"] +CMD ["app.py"] diff --git a/app.py b/app.py index d051293..ef9cc7d 100644 --- a/app.py +++ b/app.py @@ -19,5 +19,4 @@ def news(): elif request.method == 'GET': return jsonify(getNews(request.args.get('category'))) -app.run(debug=True) - \ No newline at end of file +app.run(host='0.0.0.0', debug=True, port=5000) diff --git a/readme.md b/readme.md index ee9c878..43e9125 100644 --- a/readme.md +++ b/readme.md @@ -106,5 +106,19 @@ All dependencies are listed in *requirements.txt* file. ```bash $ python app.py ``` +### Docker Install + +1. Build + + ```bash + $ docker build -t inshorts . + ``` + +2. Run + + ```bash + $ docker run -d -p 5000:5000 inshorts + ``` + diff --git a/requirements.txt b/requirements.txt index 2f8adb5..7029e42 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,3 +11,4 @@ MarkupSafe==1.0 requests==2.18.4 urllib3>=1.23 Werkzeug==0.12.2 +flask-cors