docker run -p 3000:3000 d9a82c31eab5 not working

Viewed 298
docker run -p 3000:3000 d9a82c31eab5 

docker-app start /app 
react-scripts start

wds: Project is running at http://172.17.0.2/ 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...

Looked on 172.17.0.2:3000 and there's nothing. Is there something I forgot to do? I am using docker on a new project I created with npx create-react-app docker-app.

I used a Dockerfile to create the project:

FROM node:alpine

WORKDIR '/app'

COPY package.json .
RUN npm install

COPY . .

CMD ["npm", "run", "start"]

It's not throwing an error or anything, but I am getting on my browser:

The connection has timed out

The server at 172.17.0.2 is taking too long to respond.
1 Answers
services:
  client:
    build: ./client
    volumes:
      - /app/node_modules
      - ./client/src:/app/src
    ports:
      - 3000:3000
    stdin_open: true
    tty: true
  backend:
    build: ./backend
    env_file: ./.env/backend
    ports:
      - 5000:5000
      - 5001:5001

Setting stdin_open and tty to true, fixed the issue.

Related