DEV Community

Discussion on: Utilizing the power of Docker while building MERN Apps using mern-docker

Collapse
 
pulkitj79 profile image
Pulkit Jain

Hello!

For react client, docker run is not working. I get the following output:

$ docker run -p 3000:3000 myapp-react:v1
yarn run v1.17.3
$ react-scripts start
ℹ 「wds」: Project is running at 172.17.0.2/
ℹ 「wds」: webpack output is served from
ℹ 「wds」: Content not from webpack is served from /usr/app/public
ℹ 「wds」: 404s will fallback to /
Starting the development server...

Done in 1.98s

If I run Docker ps command, it shows no running container.

What I have missed?

regards,

Collapse
 
mnaguib2611 profile image
Mohammed Naguib

this worked with me ( added -i -t flags)
docker run -i -t -p 3000:3000 myapp-react:v1

-i leaves the stdin of the container opened
-t assigns a pseudo-tty (for interactive session with shell)

Collapse
 
knhn1004 profile image
Oliver Chou

Thanks, solved my problem

Collapse
 
sujaykundu777 profile image
Sujay Kundu

Have you created the client image first.You need to create individual images for both the client and server first. Then run the above commands.