From e038aa8f7aed818c922b682414e22811e817c7e1 Mon Sep 17 00:00:00 2001 From: Clemens Wolff Date: Mon, 28 Jan 2019 15:09:49 -0500 Subject: [PATCH] Enable Heroku to pass $PORT to Docker --- Dockerfile | 4 ++-- tools/run.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index cb58a4e6..2d067f3b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,9 +22,9 @@ WORKDIR /doccano ENV DEBUG="True" ENV SECRET_KEY="change-me-in-production" -ENV BIND="0.0.0.0:80" +ENV PORT="80" ENV WORKERS="2" -EXPOSE 80 +EXPOSE ${PORT} CMD ["/doccano/tools/run.sh"] diff --git a/tools/run.sh b/tools/run.sh index acb03676..a0f0eaa1 100755 --- a/tools/run.sh +++ b/tools/run.sh @@ -6,4 +6,4 @@ if [[ ! -d "app/staticfiles" ]]; then python app/manage.py collectstatic --noinp python app/manage.py wait_for_db python app/manage.py migrate -gunicorn --bind="${BIND:-127.0.0.1:8000}" --workers="${WORKERS:-1}" --pythonpath=app app.wsgi +gunicorn --bind="0.0.0.0:${PORT:-8000}" --workers="${WORKERS:-1}" --pythonpath=app app.wsgi