Can I make docker an environment without saving code

I’m new to docker and I wonder that, can I use the docker as an application environment only?

I have the Dockerfile which let me build a Docker image and let other team-mates and server able to run my project.

FROM node:10.15.3
ADD . /app/
RUN npm install
RUN npm run build
CMD ["npm", "run","start"]

The project can be built and ran. All the thing is perfect.

However, I found that all the files will be zip into the image files. My source code and all node_modules. It makes the files too big.

And I remember that in my previous project, I will create the Linux VM and bind my project folder to the guest OS. Then I can keep developing and using the vm as a server.

Can docker do something like this? The docker only needs to load my project folder (which will pass the path when running the command).

Then it runs npm install, npm start/dev. All the library will save into my local directory. OR I run the npm start manually then the docker load my files and host.

I just need docker to be my application server to make sure I can get the same result like deployed to the Production server.

Can Docker do this?

Source: StackOverflow