Hey Peter, great article. I think what Earle is asking is why do we need to run `create-react-app` locally before creating the Dockerfile? This means that creating new applications requires the correct version of NPM and create-react-app locally before developing it in docker.
I have the exact same question. Creating the app in host machine prior to moving it to the container seems to defeat one of the purposes of using docker which is to avoid installing any softwares in the host machine. I am not sure what I am missing here.
Good question and I'd have to think about that. Once you've created the project once you won't need `create-react-app` installed. Right? So you don't need that bloat.
Comment
Hey Peter, great article. I think what Earle is asking is why do we need to run `create-react-app` locally before creating the Dockerfile? This means that creating new applications requires the correct version of NPM and create-react-app locally before developing it in docker.
Parent comment
What do you mean by "why you must start in the current machine environment"?
Replies
I have the exact same question. Creating the app in host machine prior to moving it to the container seems to defeat one of the purposes of using docker which is to avoid installing any softwares in the host machine. I am not sure what I am missing here.
Good question and I'd have to think about that. Once you've created the project once you won't need `create-react-app` installed. Right? So you don't need that bloat.
One solution would be to do something like
> docker container run -it react:app bash
$ npm add create-react-app
$ create-react-app myinitialproject
And when after you exit, only add the created project to the git repo.