From 810510a556257a0d8ca2e41125acd08e71a1e933 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alessandro=20Pezz=C3=A8?= Date: Fri, 28 May 2021 11:52:40 +0200 Subject: [PATCH] feat: allow port customization --- Resources/docker/app/Dockerfile | 2 +- gunicorn.py.ini => gunicorn.conf.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) rename gunicorn.py.ini => gunicorn.conf.py (55%) diff --git a/Resources/docker/app/Dockerfile b/Resources/docker/app/Dockerfile index 96dd580b..2c890f22 100644 --- a/Resources/docker/app/Dockerfile +++ b/Resources/docker/app/Dockerfile @@ -18,5 +18,5 @@ RUN addgroup -g 1000 -S pokeapi && \ adduser -u 1000 -S pokeapi -G pokeapi USER pokeapi -CMD gunicorn config.wsgi:application -c gunicorn.py.ini +CMD gunicorn config.wsgi:application -c gunicorn.conf.py EXPOSE 80 diff --git a/gunicorn.py.ini b/gunicorn.conf.py similarity index 55% rename from gunicorn.py.ini rename to gunicorn.conf.py index 9db1e924..bc8ebaf6 100644 --- a/gunicorn.py.ini +++ b/gunicorn.conf.py @@ -1,5 +1,6 @@ +import os from multiprocessing import cpu_count -bind = '0.0.0.0:80' +bind = "0.0.0.0:{}".format(os.environ.get("SERVER_PORT", "80")) workers = cpu_count() * 2 threads = cpu_count() * 2