I have an Angular application deployed in the container . If I log in to the container I can curl to the port 4200.
I have mapped to port 9001 to connect from my host .
But I can't curl from my host machine. What could be the issue? I think I should configure with docker bridge how to do that??
My Docker file:
FROM alpine:latest
#installing required pakages
RUN apk update
RUN apk fix
RUN apk add nodejs nodejs-npm apache2 curl yarn
RUN npm install -g @angular/cli
RUN npm install -g typescript
RUN mkdir -p /var/opt/angular
WORKDIR /opt
COPY . .
WORKDIR /opt/frontend
RUN npm install
RUN ng build
COPY start.sh /opt/frontend/start.sh
RUN chmod +x start.sh
EXPOSE 4200
CMD ["sh", "start.sh"]
Start-up script(start.sh):
#!/bin/bash
ng serve --host 0.0.0.0
While running the docker file I have specified. -p 9001:4200
RUN command1 && command2
to reduce the layers created and the image size.