I am trying to create a docker container to use for Angular development.
Using a nearly identical dockerfile to the one below, I was able to create a development container for React.
FROM node:8.9.0
ENV NPM_CONFIG_LOGLEVEL warn
ARG app_env
ENV APP_ENV $app_env
RUN mkdir -p /app1
WORKDIR /app1
COPY ./app1 ./
COPY app1/package.json /app1
RUN npm install
RUN npm update
RUN npm install -g typescript
EXPOSE 4200
RUN chmod a+x /app1/node_modules/.bin/*
ENTRYPOINT ["tail", "-f", "/dev/null"]
#ENTRYPOINT npm start
To run the container I use:
docker run -i -t -p 4200:4200 -v /var/react/{your app name}/{Your apps sub folder}/src:/{ Your apps sub folder } /src {container ID}
I then enter the container and run npm start or npm start 0.0.0.0:4200. Everything compiles successfully and says it should be running on localhost:4200 but I get a connection refused error.
I'll reiterate, using an identical dockerfile, I am able to do this with react. The only differences between the files are port numbers and mounted volumes.
As such, this makes me think it's something to do with the Angular configuration but I don't know where to begin looking. Any ideas?
thanks!