Besides setting a limit for each service (container) inside the docker-compose I'd love to know if there is any way to simply limit the memory the docker-compose stack has access to, similarly to the solution of every container but generalized for all the stack.
How can I set a memory limit for an entire docker-compose stack?
Asked Answered
like add as global? –
Argyrol
@EmersonPedroso yeah, like as global, (e.g. 4GB for all the three containers running in that stack) –
Houchens
unix.stackexchange.com/questions/537645/… –
Alephnull
As of today, there's no "global stack" memory limit (or CPU limit) option with Docker Compose (or Compose Specs).
Instead, you can:
- Limit per containers as you already suggested
- Limit at Docker daemon level as per @Mihal By comment on question
© 2022 - 2025 — McMap. All rights reserved.