Best practices to use workers - Python / Docker

I think running multiple processes is what you’re looking for. You basically want to define the web app and the worker in the services section and expose the web service in the [http_service] section of the fly.toml like so:

[processes]
app = "gunicorn app:app --log-level 'info'" //or whichever run command you prefer to use
worker = "celery -A appname worker -l INFO" // assuming you're using celery for your worker
...
//some other fly.toml config
...
[http_service]
  processes = ["app"]

As for your worker, you might want to look into a task queue like celery to handle image processing. Here’s an example of a fly.toml file in a python app if it’s helpful → Preview: multi process apps (get your workers here!) - #13 by lmzbonack