Docker, wooo!

Can be built and run in docker
This commit is contained in:
Aaron Kimbrell
2019-04-03 00:05:21 -05:00
parent 38f27f3dfe
commit 55dea340e4
3 changed files with 26 additions and 5 deletions

11
Dockerfile Normal file
View File

@@ -0,0 +1,11 @@
FROM python:3.7-slim
COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt
RUN pip install gunicorn
COPY wsgi.py wsgi.py
COPY ./app /app
EXPOSE 8000
ENTRYPOINT ["gunicorn", "-b", ":8000", "wsgi:app"]

5
run.py
View File

@@ -1,5 +0,0 @@
from app import create_app
if __name__ == '__main__':
app = create_app()
app.run()

15
wsgi.py Normal file
View File

@@ -0,0 +1,15 @@
from app import create_app
app = create_app()
@app.shell_context_processor
def make_shell_context():
"""Extend the Flask shell context."""
return {'app': app}
if __name__ == '__main__':
with app.app_context():
app.run(host='0.0.0.0')