From 27ad9b0d603c95361f88a1dbe5b4ccc596452961 Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Thu, 14 Jan 2021 20:50:27 +1100 Subject: [PATCH] this is needed to get gunicorn to run with the newer code cross-importation syntax and to have threading, workers and ssl --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index f9b3e28..ca0cbe8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ FROM ubuntu:20.04 WORKDIR /code -RUN apt-get update && apt-get -y install python3-pip python3-psycopg2 libpq-dev +RUN apt-get update && apt-get -y install python3-pip python3-psycopg2 libpq-dev gunicorn COPY requirements.txt requirements.txt RUN pip3 install -r requirements.txt -EXPOSE 5000 +EXPOSE 443 COPY . . -CMD ["python3", "/code/main.py"] +CMD ["gunicorn", "--bind=0.0.0.0:443", "--workers=2","--threads=2", "--certfile", "/etc/letsencrypt/live/book.depaoli.id.au/fullchain.pem", "--keyfile", "/etc/letsencrypt/live/book.depaoli.id.au/privkey.pem","main:app"]