From 95304bbc39d5503b2017b17270cc45689950f748 Mon Sep 17 00:00:00 2001 From: Paul Warren Date: Mon, 9 Nov 2020 14:17:17 +1100 Subject: [PATCH] Gunicorn-ised --- Dockerfile | 19 ++++++------------- gunicorn_start.sh | 3 +++ requirements.txt | 1 + 3 files changed, 10 insertions(+), 13 deletions(-) create mode 100755 gunicorn_start.sh diff --git a/Dockerfile b/Dockerfile index efaada0..ab199aa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,13 @@ -FROM debian:10.5 +FROM debian:10 MAINTAINER Paul Warren -run apt-get update -y -run apt-get install -y python3-pip python3-dev +RUN apt-get update -y && apt-get install -y python3-pip python3-dev -copy ./requirements.txt /requirements.txt +ADD . /app -WORKDIR / +WORKDIR /app -run pip3 install -r requirements.txt - - -copy ./app /app - -ENTRYPOINT ["python3"] - -CMD ["app/app.py"] +RUN pip3 install -r requirements.txt +ENTRYPOINT ["./gunicorn_start.sh"] diff --git a/gunicorn_start.sh b/gunicorn_start.sh new file mode 100755 index 0000000..8887661 --- /dev/null +++ b/gunicorn_start.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +gunicorn --chdir app app:app -w 2 --threads 2 -b 0.0.0:5002 diff --git a/requirements.txt b/requirements.txt index 04ef721..221759e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ numpy==1.16.2 Flask==1.0.2 Pillow==6.2.0 +gunicorn==20.0.4