From 7948abcb7d5cad3d12a396dcafcc2de9e54e5152 Mon Sep 17 00:00:00 2001 From: Ngure Nyaga Date: Mon, 12 Jul 2021 15:56:16 +0300 Subject: [PATCH] fix: start container on Cloud Run at $PORT --- entrypoint | 2 +- start | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/entrypoint b/entrypoint index ea271cb4..7e239949 100644 --- a/entrypoint +++ b/entrypoint @@ -36,4 +36,4 @@ until postgres_ready; do done >&2 echo 'PostgreSQL is available' -exec "$@" +exec "/start" diff --git a/start b/start index 514ec5c3..c879b1d2 100644 --- a/start +++ b/start @@ -6,6 +6,7 @@ set -o nounset python /app/manage.py collectstatic --noinput +python /app/manage.py migrate python /app/manage.py createcachetable compress_enabled() { @@ -28,4 +29,4 @@ if compress_enabled; then python /app/manage.py compress fi -/usr/local/bin/gunicorn config.asgi --bind 0.0.0.0:5000 --chdir=/app -k uvicorn.workers.UvicornWorker +/usr/local/bin/gunicorn config.asgi --bind 0.0.0.0:$PORT --chdir=/app -k uvicorn.workers.UvicornWorker