Limit resources in docker-compose v3
mem_limit is no longer supported in version 3 of docker-compose.yml file. The documentation tells that I should use the deploy.resources key instead but also that this part will only be effective with swarm or docker stack. cpu_shares, cpu_quota, cpuset, mem_limit, memswap_limit: These have been replaced by the resources key under deploy. Note that deploy configuration only takes effect when using docker stack deploy, and is ignored by docker-compose. ... as written in the docs. How do I set memory/cpu limits with docker-compose with v3 format of the yml file?
I was wondering the same thing and found this: https://github.com/docker/compose/issues/4513 So in short it's just not possible to do that, you have to use the version 2.1 of the docker-compose format to be able to specify limits that are not ignored by docker-compose up
I was searching the same too... I think the links are little but you can land here: https://docs.docker.com/compose/compose-file/#resources resources: limits: cpus: '0.001' memory: 50M reservations: cpus: '0.0001' memory: 20M and https://docs.docker.com/engine/reference/run/#runtime-constraints-on-resources for more details on constraints
docker-compose restart container if service is dead
Swarm scheduling not working as expected using filters in compose file
issues in buiding Slate with Docker
Invalid type error in Docker Compose
Django cookiecutter with Docker add pip package
Docker Compose + Swarm + Machine Networking issue
docker-compose build image parameters --force-rm --pull
linking 2 containers through docker compose
Files created by manage.py commands not chown'd from root user
Is it possible to create an intermediate image within docker-compose?
docker-compose service listen on specified interface
Does Docker-Compose allow overwriting of ports when using extends?
Jhipster Docker-compose conflict
Build multiple images with Docker Compose?
JHipster Cassandra Docker Build
Defining project name inside docker-compose configuration