From a59042716049bd5e5adb7324a64b3c330bfe714e Mon Sep 17 00:00:00 2001 From: Corry Haines Date: Mon, 26 Dec 2022 09:40:37 -0800 Subject: [PATCH] Render the Nginx config to a separate file (#273) When writing the cache size to nginx config, write it to a separate file so it doesn't confuse git status/commit. By using a rendered file, we can ignore the output completely. --- docker/.gitignore | 1 + docker/run.sh | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 docker/.gitignore diff --git a/docker/.gitignore b/docker/.gitignore new file mode 100644 index 0000000..f493233 --- /dev/null +++ b/docker/.gitignore @@ -0,0 +1 @@ +nginx.rendered.conf diff --git a/docker/run.sh b/docker/run.sh index 083b166..b8f0e69 100644 --- a/docker/run.sh +++ b/docker/run.sh @@ -2,10 +2,10 @@ # Set up cache size CACHE_SIZE="${TAKAHE_NGINX_CACHE_SIZE:-1g}" -sed -i s/__CACHESIZE__/${CACHE_SIZE}/g /takahe/docker/nginx.conf +sed s/__CACHESIZE__/${CACHE_SIZE}/g /takahe/docker/nginx.conf > /takahe/docker/nginx.rendered.conf # Run nginx and gunicorn -nginx -c "/takahe/docker/nginx.conf" & +nginx -c "/takahe/docker/nginx.rendered.conf" & gunicorn takahe.wsgi:application -b 0.0.0.0:8001 &