title: Resource limits specified in docker-compose.yml not taken into account by docker
body: <p>I am trying to set resources limits in my <strong>docker-compose.yml</strong> file.</p>
  
  <p>Here it is:</p>
  
  <pre><code>version: "3.7"
  services:
    postgres:
      build: "docker/postgres"
      container_name: "postgres"
      ports:
      - 5432:5432
      environment:
        POSTGRES_USER: prodev
        POSTGRES_PASSWORD: prodev
        POSTGRES_MULTIPLE_DATABASES: pro_dev, pro_test
      networks:
      - my_proto_app
    the_api:
      deploy:
        resources:
          limits:
            cpus: '0.001'
            memory: 50M
          reservations:
            cpus: '0.0001'
            memory: 20M
      image: the_api:latest
      ports:
      - 8080:8080
      depends_on:
      - postgres
      links:
      - postgres
      networks:
      - my_proto_app
  networks:
    my_proto_app:
      internal: false
  </code></pre>
  
  <p>However, when I run <code>docker stats</code> in order to gain insight into my resources limits, I notice that my limits are not taken into account:</p>
  
  <pre><code>CONTAINER ID        NAME                CPU %               MEM USAGE / LIMIT     MEM %               NET I/O             BLOCK I/O           PIDS
  c0b7d2fffc42        postgres            0.04%               20.89MiB / 1.952GiB   1.05%               148kB / 171kB       0B / 856kB          16
  0a0f9e482f86        api_the_api_1       2.16%               739.5MiB / 1.952GiB   37.00%              409kB / 464kB       0B / 73.7kB         59
  </code></pre>
  
  <p>Can someone please help ?</p>
  
  <p><strong>edit</strong>: I run the app with the following command: <code>docker-compose up</code> </p>