Browse Source

Use gunicorn for voting app in prod

Ben Firshman 9 years ago
parent
commit
dd03d8937a
3 changed files with 4 additions and 2 deletions
  1. 1 0
      docker-compose.yml
  2. 1 1
      voting-app/Dockerfile
  3. 2 1
      voting-app/requirements.txt

+ 1 - 0
docker-compose.yml

@@ -3,6 +3,7 @@ version: "2"
 services:
   voting-app:
     build: ./voting-app
+    command: python app.py
     volumes:
      - ./voting-app:/app
     ports:

+ 1 - 1
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

+ 2 - 1
voting-app/requirements.txt

@@ -1,2 +1,3 @@
 Flask
-Redis
+Redis
+gunicorn