-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docker create-react-app without installing node, npm in local system. #3002
Comments
I'm not sure what relevance this has to this repository, but Docker compose is unnecessary. On that note, your |
@Timer : Thanks a lot 😄 , So, I finally fixed it. No changes in So, the complete solution is if anyone interested: Add Dockerfile to build your own imageYou can remove extra packages if you don't like, or add other packages too.
Build your
|
|
Thank you for pointing me to |
Great! Add this to your bashrc & enjoy containerised react everywhere!
|
Because we are using
Docker
, we should not installnode
,npm
,create-react-app
in our development machine, not even for generating
create-react-app
scaffold.For this purpose I am using 2-step docker configuration:
create-react-app
and we can use it to generate
create-react-app
scaffold.nodemon
,npm
, development servers, etc.Build docker image for create-react-app
Because we are not installing
create-react-app
locally in our development machine, Let's build new docker container for it.Dockerfile
my failed attempt to solve this problem without
docker-compose
docker build . -t react-cli
create-react-app
scaffold using this image:EXPECTED
myApp
in my current directory.RESULT
Got nothing 😄 . Looks like it is generating app inside
docker
container.Working Solution: using docker-compose
Because I was unable to solve it by using just
docker
command, I am solving it usingdocker-compose
.docker-compose.yml
Usage
Now using
docker-compose
we can generate our react application:Everthing should work this time. And you should get react generated application inside
myApp
directory.
If anyone knows how to use
react-cli
image to generatecreate-react-app
without using docker-compose.yml file, please let me know.Thanks
The text was updated successfully, but these errors were encountered: