R
R
Ramil2018-02-14 11:17:53
macOS
Ramil, 2018-02-14 11:17:53

How to get a site on localhost from a Docker container on MacOS?

There is a Nodejs project with a Dockerfile:

FROM node
WORKDIR /var/app
COPY . /var/app
RUN yarn

I built the image and now I run it like this:
docker run -d -p 3000:3000 --name myapp rshaibakov/myapp yarn run dev

Everything seems to be according to the instructions. But how can I access the site in the browser? localhost:3000 says page not found.
Tried setting up proxy as described here . In this case, localhost:3000 says that there is no Internet connection.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Ramil, 2018-02-14
@rshaibakov

Indicated listening to the address 0.0.0.0 in the express and it helped. Thanks again Anton Kucherov for the answer

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question