Skip to content

tux-o-matic/python-asgi-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

python-asgi-demo

Python web app demo using the Quart framework and the Hypercorn ASGI server. The goal is to have an ASGI web app ready to be running in a container locally or in K8s. The app starts a single asyncio worker programmatically for Hypercorn.

Local development

After cloning the repo and changing directory into it.

python3 -m venv venv
source venv/bin/activate
pip install -f requirements.txt

Building the image locally

The provided Containerfile makes use of an s2i Python 3.12 minimal image

podman build -t python-asgi .

Running the container locally

podman run -it --rm -e APP_FILE=asgi.py -p 0.0.0.0:8080:8080 python-asgi

For Kubernetes

Configure these things:

  • Pass an ENV of APP_FILE=asgi.py.
  • Set HTTP probes against /health.
  • Container port and Service should point to 8080.

About

Python web app demo using ASGI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published