diff options
| author | 2021-03-04 11:58:05 +0800 | |
|---|---|---|
| committer | 2021-03-04 11:58:05 +0800 | |
| commit | b5a7dc48cd1ffbb0471858660d58b8b2e6a115fa (patch) | |
| tree | 3d9b98700df69ace83c90a31c8625710639427db /manage.py | |
| parent | Hide arrow to the right of More below the 1024px breakpoint (diff) | |
| parent | Update Dockerfile (diff) | |
Resolve conflicts
Diffstat (limited to 'manage.py')
| -rwxr-xr-x | manage.py | 22 | 
1 files changed, 17 insertions, 5 deletions
| @@ -7,10 +7,10 @@ import time  from typing import List  import django +import gunicorn.app.wsgiapp  from django.contrib.auth import get_user_model  from django.core.management import call_command, execute_from_command_line -  DEFAULT_ENVS = {      "DJANGO_SETTINGS_MODULE": "pydis_site.settings",      "SUPER_USERNAME": "admin", @@ -156,10 +156,22 @@ class SiteManager:              call_command("runserver", "0.0.0.0:8000")              return -        import pyuwsgi - -        # Run uwsgi for production server -        pyuwsgi.run(["--ini", "docker/uwsgi.ini"]) +        # Patch the arguments for gunicorn +        sys.argv = [ +            "gunicorn", +            "--preload", +            "-b", "0.0.0.0:8000", +            "pydis_site.wsgi:application", +            "--threads", "8", +            "-w", "2", +            "--max-requests", "1000", +            "--max-requests-jitter", "50", +            "--statsd-host", "graphite.default.svc.cluster.local:8125", +            "--statsd-prefix", "site", +        ] + +        # Run gunicorn for the production server. +        gunicorn.app.wsgiapp.run()  def main() -> None: | 
