I am trying to run a react app using docker. Here are my steps:
I have created a react app using react-native-cli and added Dockerfile.dev file. My Dockerfile.dev file contains this code:
# Specify a base image
FROM node:alpine
WORKDIR '/app'
# Install some depenendencies
COPY package.json .
RUN yarn install
COPY . .
# Uses port which is used by the actual application
EXPOSE 3000
# Default command
CMD ["yarn", "run", "start"]
Then I execute this command and get this output. But it doesn't show any port to access it.
docker build -f Dockerfile.dev .
OP: Successfully built ad79cd63eba3
docker run ad79cd63eba3
OP:
yarn run v1.22.4
$ 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...
Done in 2.02s.
Can anybody tell me how I start the development server and it shows me the port like Http://localhost:3000 to access it.
Full code: https://github.com/arif2009/frontend.git