React App Exits Immediately with Docker Run Command

Last updated on October 1, 2020 A Goodman Loading... Post a comment


After starting a Docker container with a React app inside by performing the following command:

docker run -p 3000:3000 [my-container-id]

Your React app may exit immediately with the output like this:

[email protected] client % docker run -p 3000:3000 33c988fb2142

> [email protected] start /app
> react-scripts start

ℹ 「wds」: Project is running at
ℹ 「wds」: webpack output is served from 
ℹ 「wds」: Content not from webpack is served from /app/public
ℹ 「wds」: 404s will fallback to /
Starting the development server...

[email protected] client % 

This error is not on your side but caused by recent updates of the Create React App library.


The solution is quite simple. All you need to do is just add the -it flag to your command:

docker run -it -p 3000:3000 [container-id]

In my case:

docker run -it -p 3000:3000 33c988fb2142 
Notify of
Inline Feedbacks
View all comments

Related Articles