Test of how to handle background processes with FastAPI, Celery, and Docker.
Set up the containers:
$ docker-compose up -d --build
Open your browser to http://localhost/docs to view docs
Trigger a new task:
$ curl http://localhost/calculate -H "Content-Type: application/json" --data '{"x": 1, "y": 1, "operation": "+"}'
Check the status:
$ curl http://localhost/tasks/<TASK_ID>
Get list of all tasks:
$ curl http://localhost/tasks/
You need to check the code before committing. Install pre-commit and add as a hook:
$ pip install pre-commit
$ pre-commit install
Run manually:
$ pre-commit run --all-files
configure sentry dsn in .env file
SENTRY_DSN=https://***.ingest.sentry.io/***
SENTRY_ENV=env