Skip to content

Commit dd03d89

Browse files
committed
Use gunicorn for voting app in prod
1 parent 1a0b0c8 commit dd03d89

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ version: "2"
33
services:
44
voting-app:
55
build: ./voting-app
6+
command: python app.py
67
volumes:
78
- ./voting-app:/app
89
ports:

voting-app/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ ADD . /app
1515
EXPOSE 80
1616

1717
# Define our command to be run when launching the container
18-
CMD ["python", "app.py"]
18+
CMD gunicorn app:app -b 0.0.0.0:80 --log-file - --access-logfile - --workers 4 --keep-alive 0

voting-app/requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
Flask
2-
Redis
2+
Redis
3+
gunicorn

0 commit comments

Comments
 (0)