React app exiting in docker container with exit code 0

后端 未结 4 2098
无人共我
无人共我 2020-11-27 07:48

I am trying to create a docker-compose setup with nginzx, flask, and react. I started my react app with react-create-app (https://github.com/facebook/create-react-app) and h

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-27 08:22

    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
    

提交回复
热议问题