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.
This commit is contained in:
Corry Haines 2022-12-26 09:40:37 -08:00 committed by GitHub
parent b53504fe64
commit a590427160
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

1
docker/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
nginx.rendered.conf

View file

@ -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 &