create-react-app-docker icon indicating copy to clipboard operation
create-react-app-docker copied to clipboard

Simplify setup

Open johnnymo87 opened this issue 7 years ago • 2 comments

johnnymo87 avatar Mar 27 '17 13:03 johnnymo87

@johnnymo87 perfect, it works for me, even it check changes, but it installs all modules on my host machine instead of the container.

egor-miasnikov avatar Mar 27 '17 19:03 egor-miasnikov

@j0gurt Try this: add RUN npm install to the dockerfile before the CMD line, remove npm install && from the CMD line, and build the image. If you run the container without a volume, you will see node_modules inside the container but not your local machine. If you run the container with a volume, the lack of node_modules on your local machine will make the node_modules in the container disappear. So if you want to develop with a volume, you have to have node_modules on your local machine one way or another. If you don't want to develop with a volume, you will have to rebuild the image every time you change anything.

johnnymo87 avatar Mar 27 '17 20:03 johnnymo87