I'm new to Docker and I tried to run a container of the create-react-app
image so these are the steps that I have done:
npx create-react-app frontend
I created a
Dockerfile.dev
like below:FROM node:alpine WORKDIR '/app' COPY package.json . RUN npm install COPY . . CMD ["npm" , "run" , "start"]
I used this command to build the image:
docker build -f Dockerfile.dev .
When i run the container using the image id provided:
docker run -p 3000:3000 my_docker_image_id
Nothing happens, as seen in this screenshot.
But when I add the -i
argument to my command everything works fine, as seen in this screenshot:
docker run -p 3000:3000 -i my_docker_image_id
Any idea please?