DEV Community

Discussion on: Learn Docker - from the beginning, part II volumes

Collapse
neskhodovskiy profile image
Serhiy Neskhodovskiy • Edited on

Hello Chris, thanks for the tutorial. I just noticed you didn't say anything about removing the "COPY . ." line from the Dockerfile after you have linked the volume. I assume there's no longer a need to copy the app into the container. Some would say "it's obvious" and some would say "who cares" since the volume is mounted later and overrides the directory anyway, but in my opinion a note on how to avoid redundant operations and keep things clean will make a nice addition to an otherwise great article.

Collapse
thomasroest profile image
Thomas Roest • Edited on

what about npm install in the Dockerfile? You don't need that either right? Isn't it a better idea to only mount a src directory?

Collapse
jplindstrom profile image
Johan Lindstrom

Do you not need the COPY . . for the docker build step? The volume is only mounted during docker run.