First, a bit of baseline info: Every command in a Dockerfile (RUN, COPY, ADD, etc) is a separate layer on top of the previous one. Layers are immutable. So if your second command changes the same files that were changed in the first - you get a new layer with a modified copy of those files.
That’s why you often see commands like
RUN apt update \
&& apt install bla-bla \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get purge --auto-remove -y bla \
&& rm -rf /src/*.deb
This is done so that in one layer you add what you need and immediately remove what you don’t.
From this follows something not entirely obvious. In this set of commands:
COPY ./ /app
RUN chown -R blabla /app
you get two nearly identical layers with /app files.
Meaning the image size grows.
Large image size increases app startup time and storage cost.