I use Docker version 17.03.0-ce + docker-compose file api v3. How can I limit the resources used in the docker-compose file? Particularly interested in RAM and disk

    2 answers 2

    This is beautifully described in the official documentation.

    resources: limits: cpus: '0.001' memory: 50M reservations: cpus: '0.0001' memory: 20M 
    • It also says that it is written in deploy. And it works only for the cluster. Is not it so? - Chizhov Roman
    • @ChizhovRoman can show where? - Zhukov Roman
    • right here. category deployed . This is the case where it takes you to do it. And resources inside deploy - Chizhov Roman
    • When I try to use resources outside of deploy, I get an error Unsupported config option for services.web: 'resources' - Chizhov Roman

    No Only through docker run