diff --git a/docs/concepts/deploying.md b/docs/concepts/deploying.md index 0b6f64c92..91099152e 100644 --- a/docs/concepts/deploying.md +++ b/docs/concepts/deploying.md @@ -100,6 +100,20 @@ For example, when we Dockerize the Guardrails API for internal use, our final li ```Dockerfile CMD gunicorn --bind 0.0.0.0:8000 --timeout=90 --workers=4 'guardrails_api.app:create_app(None, "config.py")' ``` +Or using uvicorn, we first create a wrapper: + +```python +# app_wrapper.py +from guardrails_api.app import create_app + +app = create_app(None, "config.py") +``` + +And then we invoke the wrapper: + +```bash +CMD uvicorn app_wrapper:app --host 0.0.0.0 --port 8000 +``` This line starts the Guardrails API Flask application with a gunicorn WSGI server. It specifies what port to bind the server to, as well as the timeout for workers and the maximum number of worker threads for handling requests. @@ -130,4 +144,4 @@ For example, you should define your Guards in the `config.py` that is loaded ont Go ahead and deploy your dockerized Guardrails server on any cloud! We have guides on how to deploy Guardrails on specific clouds. -- [Deploying Guardrails on AWS](https://www.guardrailsai.com/docs/how_to_guides/deploying_aws) \ No newline at end of file +- [Deploying Guardrails on AWS](https://www.guardrailsai.com/docs/how_to_guides/deploying_aws)