I would like to run my node-js application in a docker instance, but at the same time, I would like to change some files (like .env or content-related files) without having to rebuild the docker-image. Currently, I build the image with this dockerfile:
FROM node:16
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm i --production
COPY . .
CMD ["node", "main.js"]
When I run the image on my Synology NAS I mounted a volume to the path /usr/scr/app`, but this does not change the behavior of the docker app. It seems that all node sources are already in the image (or are ignored).
My goal would be that the image only contains node modules and the source files (.js) would be supplied via a mounted volume.
How can I achieve this behavior?