Skip to content

Commit 76ff8d9

Browse files
authored
Merge pull request #1239 from bet0x/patch-1
Update deploying.md
2 parents 2431a70 + dc024ed commit 76ff8d9

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

docs/concepts/deploying.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,20 @@ For example, when we Dockerize the Guardrails API for internal use, our final li
100100
```Dockerfile
101101
CMD gunicorn --bind 0.0.0.0:8000 --timeout=90 --workers=4 'guardrails_api.app:create_app(None, "config.py")'
102102
```
103+
Or using uvicorn, we first create a wrapper:
104+
105+
```python
106+
# app_wrapper.py
107+
from guardrails_api.app import create_app
108+
109+
app = create_app(None, "config.py")
110+
```
111+
112+
And then we invoke the wrapper:
113+
114+
```bash
115+
CMD uvicorn app_wrapper:app --host 0.0.0.0 --port 8000
116+
```
103117
104118
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.
105119
@@ -130,4 +144,4 @@ For example, you should define your Guards in the `config.py` that is loaded ont
130144

131145
Go ahead and deploy your dockerized Guardrails server on any cloud! We have guides on how to deploy Guardrails on specific clouds.
132146

133-
- [Deploying Guardrails on AWS](https://www.guardrailsai.com/docs/how_to_guides/deploying_aws)
147+
- [Deploying Guardrails on AWS](https://www.guardrailsai.com/docs/how_to_guides/deploying_aws)

0 commit comments

Comments
 (0)