Publishing Changes Question

Docker training “Running multi container Applications” under the topic “Publishing Changes”
Change index.js
When I make the change on the container version of the file, it reflects the change on localhost:3001/api
however if I make the change on my local file, until it is pushed into the container it is not going to reflect the change, for all obvious reasons.
When I make the change on my local file, the only way to push that file to the container will be building it. Is that correct?
I am little confused because in the training Mosh made the change in the file, I was really not sure if he changed the file in the container or the localhost. Please clarify. Thanks.