From dd03d8937a48ea8dc6e70c5d9677e7b42d2b21d7 Mon Sep 17 00:00:00 2001 From: Ben Firshman Date: Fri, 17 Jun 2016 21:13:51 -0700 Subject: [PATCH] Use gunicorn for voting app in prod --- docker-compose.yml | 1 + voting-app/Dockerfile | 2 +- voting-app/requirements.txt | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 39a575a..9ad272a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,6 +3,7 @@ version: "2" services: voting-app: build: ./voting-app + command: python app.py volumes: - ./voting-app:/app ports: diff --git a/voting-app/Dockerfile b/voting-app/Dockerfile index 1fdec68..99f0aae 100644 --- a/voting-app/Dockerfile +++ b/voting-app/Dockerfile @@ -15,4 +15,4 @@ ADD . /app EXPOSE 80 # Define our command to be run when launching the container -CMD ["python", "app.py"] +CMD gunicorn app:app -b 0.0.0.0:80 --log-file - --access-logfile - --workers 4 --keep-alive 0 diff --git a/voting-app/requirements.txt b/voting-app/requirements.txt index 8862084..430bfdc 100644 --- a/voting-app/requirements.txt +++ b/voting-app/requirements.txt @@ -1,2 +1,3 @@ Flask -Redis \ No newline at end of file +Redis +gunicorn