-
Notifications
You must be signed in to change notification settings - Fork 301
Closed
Labels
Description
Expected behavior
Running a server on port 3000, in a container which exposes port 3000 should map the container to localhost:3000.
Actual behavior
Accessing localhost:3000 in the browser results in ERR_CONNECTION_REFUSED. However, the container is started successfully and the server starts listening on port 3000.
Information
-
Diagnostic ID: 3F7A5024-D386-4782-8CBD-DFEB8343EE67/2017-07-19_21-23-58
-
OS: Windows 10
-
Docker version: 17.06.0-ce, build 02c1d87
-
Dockerfile:
FROM node:8
ADD package.json /tmp/package.json
RUN cd /tmp && npm install
RUN mkdir -p /usr/src/app && cp -a /tmp/node_modules /usr/src/app
RUN npm i -g forever
WORKDIR /usr/src/app
ADD . /usr/src/app
EXPOSE 3000
CMD npm run server:prod
Steps to reproduce the behavior
docker build -t sample_service .docker run --net=host sample_service
Additional information
Running the same service in bridge mode docker run -p 3000:3000 sample_service works just fine.