I have some issue with ng serve in my docker container running by docker-compose.
Dockerfile
FROM node:7.1
RUN mkdir -p /u
Webpack uses a port to do live reload of the application. That port is 49153 by default.
You have to expose and bind that port in the container to the host port and that should solve your problem.
So, add this to your Dockerfile.
FROM node:7.1
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY package.json /usr/src/app
RUN npm install
RUN npm install -g angular-cli
COPY . /usr/src/app
EXPOSE 4200 49153
CMD [ "npm", "start" ]'
And this to your docker-compose.yml.
web:
build: .
ports:
- '8089:4200'
- '49153:49153'
volumes:
- .:/usr/src/app/
environment:
- NODE_ENV=dev
command: bash -c "npm start"