I have a small React app that I would like to run in a Docker container. I have the following Dockerfile filled out like this:
# base image
FROM node:9.6.1
# set working directory
RUN mkdir /app
WORKDIR /app
ENV PATH /app/node_modules/.bin:$PATH
# install and cache app dependencies
COPY package-lock.json /app/package-lock.json
COPY package.json /app/package.json
COPY . /app
RUN npm install
# start app
CMD ["npm", "start"]
After doing a build, I was able to correctly (I think) create an image.
>docker image list
REPOSITORY TAG IMAGE ID CREATED SIZE
notes latest e4ccada07b84 18 hours ago 846MB
However, when I run on the image, it does run npm start, but not in the port I specified and if I go to the URL it provides it can't connect to anything.
>docker run -p 3030:3030 notes:latest
You can now view notes in the browser.
Local: http://localhost:3000/
On Your Network: http://172.17.0.4:3000/
Note that the development build is not optimized.
To create a production build, use npm run build.
What am I missing to get this running in a container correctly?
docker run -p 3030:3000 notes:latest