Agregado docker!!!

Siempre e querido usarlo y esta parece ser una buena oportunidad para
comenzar :3
This commit is contained in:
Daniel Cortes
2019-03-13 01:34:43 -03:00
parent 5fbff72806
commit 34c8becda9
4 changed files with 29 additions and 0 deletions

13
Dockerfile Normal file
View File

@@ -0,0 +1,13 @@
FROM python:alpine
RUN mkdir /app
COPY . /app
WORKDIR /app
RUN pip install --no-cache-dir -r requirements.txt
EXPOSE 5000
ENV GUNICORN_WORKERS 2
ENV GUNICORN_BIND 0.0.0.0:8080
CMD ["gunicorn", "--config", "gunicorn.conf", "run:app"]

7
gunicorn.conf Normal file
View File

@@ -0,0 +1,7 @@
import os
for k,v in os.environ.items():
if k.startswith("GUNICORN_"):
key = k.split('_', 1)[1].lower()
locals()[key] = v

3
requirements.txt Normal file
View File

@@ -0,0 +1,3 @@
Flask==1.0.2
Flask-SQLAlchemy==2.3.2
gunicorn==19.9.0

6
run.py Normal file
View File

@@ -0,0 +1,6 @@
from files import create_app
app = create_app()
if __name__ == '__main__':
app.run(host='0.0.0.0', debug=True)