# Best practices to use workers - Python / Docker

**URL:** <https://community.fly.io/t/best-practices-to-use-workers-python-docker/12614>\
**Category:** Questions / Help\
**Tags:** login-only\
**Created:** [May 1, 2023, 11:17am UTC](https://community.fly.io/t/best-practices-to-use-workers-python-docker/12614 "2023-05-01T11:17:36Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![shortdiv](https://sea1.discourse-cdn.com/fly1/user_avatar/community.fly.io/shortdiv/32/2518_2.png) [@shortdiv](https://community.fly.io/u/shortdiv)\
**Post date:** [May 1, 2023, 3:48pm UTC](https://community.fly.io/t/best-practices-to-use-workers-python-docker/12614/2 "2023-05-01T15:48:22Z")

</div>

I think [running multiple processes](https://fly.io/docs/apps/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:

```auto
[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](https://community.fly.io/t/preview-multi-process-apps-get-your-workers-here/2316/13)

---

_[View the full topic](https://community.fly.io/t/best-practices-to-use-workers-python-docker/12614)._
