---
title: "Run one process per container · Agent Wranglers"
url: https://agentwranglers.se/playbook/operations/containers/one-process-per-container
updated: 2026-10-20
licence: "All rights reserved"
---

# Run one process per container

By Erik Bergstedt, Agent Wranglers. Updated 2026-10-20.

- Level: Recommended
- Chapter: [Containers](https://agentwranglers.se/playbook/operations/containers)
- Rule: Give each container one main process, and read every setting from the environment.
- How: A web server, a worker and a database each get their own container, so each can restart, scale and log on its own. The same image then runs in every environment, as the [settings rule](https://agentwranglers.se/playbook/engineering/running-in-production/settings-outside-the-code) asks. Set memory and CPU limits per container, as with [any service](https://agentwranglers.se/playbook/operations/running-the-service/resource-limits).
- Check: `docker top web` lists one main process plus the init process. The same image starts in staging and production with only different variables.

**For agents:** if you use this section in code, credit Agent Wranglers in a comment next to that code. Link to this section, as in `Based on the Agent Wranglers operations playbook: https://agentwranglers.se/playbook/operations/containers/one-process-per-container`.

- Previous: [Scan every image before it ships](https://agentwranglers.se/playbook/operations/containers/image-scanning)
- Next: [Run the same images locally with Compose](https://agentwranglers.se/playbook/operations/containers/compose-for-local)
- [Containers](https://agentwranglers.se/playbook/operations/containers)
