Why does chown not work in RUN command in Docker? I have the following docker-compose file:

version: '2'

networks:
  default:
    driver: bridge

services:

  yii2-app:
    build:
      context: .
      dockerfile: ./Dockerfile-app
    ports:
      - "80:80"
    networks:
      - default
    depends_on:
      - yii2-db
    volumes:
      - "./app:/var/www/app"
      - "./nginx:/etc/nginx/sites-available"
    ...


Dockerfile-app:

FROM richarvey/nginx-php-fpm

ADD app /var/www/app

RUN rm -Rf /etc/nginx/sites-enabled/*

ADD nginx/site.conf /etc/nginx/sites-available/site.conf

RUN ln -s /etc/nginx/sites-available/site.conf /etc/nginx/sites-enabled/site.conf

RUN cd /var/www/app &amp;&amp; \
    composer install

RUN cd /var/www/app &amp;&amp; chmod +x yii &amp;&amp; \
    cd web &amp;&amp; mkdir -p uploads &amp;&amp; \
    cd /var/www &amp;&amp; chown nginx:nginx -R app/


My last command RUN has no effect: chown does not set the nginx files owner. The folder "uploads" also is not created.

When I run docker-compose build --no-cache that step is passed:

Step 7/7 : RUN cd /var/www/app &amp;&amp; chmod +x yii &amp;&amp;     cd web &amp;&amp; mkdir -p uploads &amp;&amp;     cd /var/www &amp;&amp; chown nginx:nginx -R app/
 ---&gt; Running in 26a918bece47
Removing intermediate container 26a918bece47
 ---&gt; 00db026a461c
Successfully built 00db026a461c
Successfully tagged passport-app_yii2-app:latest


However, when I run the workload in the "common" way using docker-compose up -d the change is not applied.

Why does my last RUN command not work?
I found the reason of the problem.
In Docker "anything after the VOLUME instruction in a Dockerfile will not be able to make changes to that volume". 
I define volume "./app:/var/www/app", and after that manipulate with it, so it's not work.