React app exiting in docker container with exit code 0 React app exiting in docker container with exit code 0 nginx nginx

React app exiting in docker container with exit code 0


Adding: stdin_open: true to the React component of my docker-compose file fixed my issue.

Example:

version: '3.1'services:    react:        build:            context: ../react-app/            dockerfile: ./Dockerfile        container_name: react        volumes:            - ../react-app:/usr/src/app        networks:            my-network:                aliases:                    - react-app        expose:            - 3000        ports:            - "3000:3000"        stdin_open: true


It looks like an issue with [React-Scripts] v3.4.1. Please look into this link


Ran into same issue. Below mentioned steps resolved my problem:1. add stdin_open: true

version: '3.1'services:  nginx:    .    .  react:    stdin_open: true    .    .

2. Do not forget to build the container again after the above mentioned change is made.

docker-compose downdocker-compose up --build