diff --git a/docker/Dockerfile b/docker/Dockerfile index 4f38fa9..450c955 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -24,6 +24,6 @@ CMD [ \ # might use exact migration hash here instead of upgrading to the latest "heads" "alembic upgrade heads \ && \ - gunicorn --workers=2 --worker-class=uvicorn.workers.UvicornWorker --bind=0.0.0.0:8000 \ - geodata.main:app --root-path=/api/v1" \ + gunicorn --workers=2 --worker-class=util.MyUvicornWorker --bind=0.0.0.0:8000 \ + geodata.main:app" \ ] diff --git a/src/util.py b/src/util.py new file mode 100644 index 0000000..c52f880 --- /dev/null +++ b/src/util.py @@ -0,0 +1,5 @@ +from uvicorn.workers import UvicornWorker + + +class MyUvicornWorker(UvicornWorker): + CONFIG_KWARGS = {"root-path": "/api/v1"}