support custom number of gunicorn workers

This commit is contained in:
FuzzyGrim
2023-09-30 17:05:54 +02:00
parent a70875ad98
commit e5dafcdc56
3 changed files with 3 additions and 1 deletions

View File

@@ -64,6 +64,7 @@ volumes:
| HTTPS_COOKIES | Bool | Cookies over HTTPS | No | False | [SESSION_COOKIE_SECURE](https://docs.djangoproject.com/en/4.1/ref/settings/#std-setting-SESSION_COOKIE_SECURE) and [CSRF_COOKIE_SECURE](https://docs.djangoproject.com/en/4.1/ref/settings/#std-setting-CSRF_COOKIE_SECURE)|
| REGISTRATION | Bool | User registration | No | True | |
| ADMIN_ENABLED | Bool | Django admin page | No | False | |
| WEB_CONCURRENCY| Int | Number of worker processes | No | 1 | [Recommend (2 x $num_cores) + 1](https://docs.gunicorn.org/en/latest/design.html#how-many-workers) |
| DEBUG | Bool | Django debug mode | No | False | |

View File

@@ -7,6 +7,7 @@ services:
environment:
- TMDB_API=TMDB_API_KEY
- MAL_API=MAL_API_KEY
- WEB_CONCURRENCY=2
volumes:
- ./db:/yamtrack/db
ports:

View File

@@ -11,4 +11,4 @@ groupmod -o -g "$PGID" abc
usermod -o -u "$PUID" abc
chown -R abc:abc db
exec gosu abc:abc gunicorn --bind :8000 config.wsgi:application
exec gosu abc:abc gunicorn --bind :8000 --timeout 120 --preload config.wsgi:application