diff --git a/Dockerfile b/Dockerfile index 8975a393e3..77d8acca1c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,5 @@ FROM docker.io/library/python:3.11-slim-bullseye -ENV GUNICORN_WORKERS=1 -ENV GUNICORN_THREADS=1 -ENV GUNICORN_BIND="0.0.0.0:8000" -ENV GUNICORN_TIMEOUT=400 - - ENV CG_SQL_DATABASE_URI="sqlite:///:memory:" ENV CG_SECRET_KEY="key" @@ -29,7 +23,7 @@ ENV TRAILBLAZER_SERVICE_ACCOUNT_AUTH_FILE="auth_file" WORKDIR /home/src/app -COPY pyproject.toml poetry.lock ./ +COPY pyproject.toml poetry.lock gunicorn.conf.py ./ RUN pip install --no-cache-dir poetry \ && poetry config virtualenvs.create false \ @@ -38,14 +32,5 @@ RUN pip install --no-cache-dir poetry \ COPY cg ./cg CMD gunicorn \ - --workers=$GUNICORN_WORKERS \ - --bind=$GUNICORN_BIND \ - --threads=$GUNICORN_THREADS \ - --timeout=$GUNICORN_TIMEOUT \ - --proxy-protocol \ - --forwarded-allow-ips="10.0.2.100,127.0.0.1" \ - --log-syslog \ - --access-logfile - \ - --error-logfile - \ - --log-level="debug" \ - cg.server.auto:app + --config gunicorn.conf.py \ + cg.server.auto:app \ No newline at end of file diff --git a/gunicorn.conf.py b/gunicorn.conf.py new file mode 100644 index 0000000000..b4b462c076 --- /dev/null +++ b/gunicorn.conf.py @@ -0,0 +1,9 @@ +bind = "0.0.0.0:8000" +threads = 4 +timeout = 400 +loglevel = "debug" +protocol = "proxy" +syslog = True +forwarded_allow_ips = "10.0.2.100,127.0.0.1" +accesslog = "-" +workers = 2 diff --git a/poetry.lock b/poetry.lock index 0429cd0963..7903d670bf 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2238,13 +2238,13 @@ test = ["covdefaults (>=2.3)", "coverage (>=7.2.7)", "coverage-enable-subprocess [[package]] name = "werkzeug" -version = "3.0.3" +version = "3.1.3" description = "The comprehensive WSGI web application library." optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" files = [ - {file = "werkzeug-3.0.3-py3-none-any.whl", hash = "sha256:fc9645dc43e03e4d630d23143a04a7f947a9a3b5727cd535fdfe155a17cc48c8"}, - {file = "werkzeug-3.0.3.tar.gz", hash = "sha256:097e5bfda9f0aba8da6b8545146def481d06aa7d3266e7448e2cccf67dd8bd18"}, + {file = "werkzeug-3.1.3-py3-none-any.whl", hash = "sha256:54b78bf3716d19a65be4fceccc0d1d7b89e608834989dfae50ea87564639213e"}, + {file = "werkzeug-3.1.3.tar.gz", hash = "sha256:60723ce945c19328679790e3282cc758aa4a6040e4bb330f53d30fa546d44746"}, ] [package.dependencies]