My aim is to dockerize my simple angular website and test it locally. Given below is the Dockerfile.
# STEP 1 build static website
FROM node:alpine as builder
RUN apk update && apk add --no-cache make git
# Create app directory
WORKDIR /app
# Install app dependencies
COPY package.json package-lock.json /app/
RUN cd /app && npm set progress=false && npm install
# Copy project files into the docker image
COPY . /app
RUN cd /app && npm run build
# STEP 2 build a small nginx image with static website
FROM nginx:alpine
## Remove default nginx website
RUN rm -rf /usr/share/nginx/html/*
## From 'builder' copy website to default nginx public folder
COPY --from=builder /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
I'm executing following commands on top of this Dockerfile.
docker build .
docker tag a585f0653f3b abameerdeen/website:latest
docker run -p 80:8000 abameerdeen/website:latest
docker ps
Gives following result.
Still, I;m unable to access the website on http://localhost:8000.
I tried following solutions, but result won't change. I'm on an ubuntu machine which has nginx installed locally too.
EXPOSE 80 in Dockerfile and docker run -p 80:8000 abameerdeen/website:latest
EXPOSE 80 in Dockerfile and docker run abameerdeen/website:latest
This is the status of ports in my local machine.

Edit :Updated port numbers.

docker run -p 8000:80 -d abameerdeen/website:latest