This project provides a FastAPI webhook server that listens for MinIO bucket notifications (object created/deleted) in near real time. It is designed for easy Docker deployment and integration with your knowledge base or downstream processing.
- Listens on port 5005,
/minio-eventsendpoint - Handles object creation and deletion events from MinIO
- Ready for extension to integrate with your own knowledge base logic
- Dockerized for production or local testing
docker build -t fastapi-minio-webhook .
docker run -p 5005:5005 fastapi-minio-webhookUse mc on the MinIO server/host to add a webhook event:
mc admin config set myminio notify_webhook:primary endpoint="http://192.168.1.35:5005/minio-events"
mc admin service restart myminioThen, bind the webhook to the bucket you want to monitor:
mc event add myminio/obsidian-vault arn:minio:sqs::primary:webhook --event "put,delete"- Replace
myminiowith your MinIO alias (check viamc alias ls) - Replace
mybucketwith your bucket name - Replace
HOSTwith your Docker host's IP orhost.docker.internal(as appropriate)
Upload or delete files from your MinIO bucket and observe event logs in the FastAPI service.
Edit main.py and add your integration in the add_file_to_knowledge and remove_file_from_knowledge functions.
-
Optional: Edit
requirements.txtandmain.pyas needed. -
For local development, you can run without Docker:
pip install -r requirements.txt uvicorn main:app --reload --host 0.0.0.0 --port 5005
- Make sure your MinIO server can reach the webhook server URL (network/firewall/Docker configuration).
- See the MinIO Event Notification docs for more info.