docker-compose stops immediately after starting react app created using create-react-app

Adding stdin_open: true to the docker-compose file solved the issue for me. This was suggested in the corresponding github issue.


As per docker run docs:

In foreground mode ... docker run can start the process in the container and attach the console to the process’s standard input, output, and standard error. It can even pretend to be a TTY (this is what most command line executables expect) and pass along signals.

For docker-compose.yaml, the analogous docker run counterpart is tty: true. So you should add tty: true to your docker-compose.yaml and it would do the trick.