title: Limit resources in docker-compose v3
body: <p>mem_limit is no longer supported in version 3 of docker-compose.yml file. The documentation tells that I should use the <code>deploy.resources</code> key instead but also that this part will only be effective with swarm or docker stack.</p>
  
  <blockquote>
    <p>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.</p>
  </blockquote>
  
  <p>... <a href="https://docs.docker.com/compose/compose-file/compose-versioning/#/version-2x-to-3x" rel="noreferrer">as written in the docs</a>.</p>
  
  <p>How do I set memory/cpu limits with docker-compose with v3 format of the yml file?</p>