filmov
tv
Angular Web App in Docker Container | Build Docker Image | Use Docker Hub
Показать описание
Prerequisites of this lab are to
1) install WSL2
2) Install Docker Desktop
3) Make an account on the docker hub
Commands I used:
dockerfile content:
#Stage 1:
FROM node:latest as node
WORKDIR /app
COPY . .
RUN npm install
RUN npm run build --prod
#Stage: 2
FROM nginx:alpine
COPY --from=node /app/dist/bbbank-ui /usr/share/nginx/html
Create an image
docker build -t {repo pointing to image} -f Dockerfile .
list of images installed:
docker images
list of all containers:
docker ps -a
run a container:
docker run -it --rm -p 8000:80 --name {container-name} {image-name}
1) install WSL2
2) Install Docker Desktop
3) Make an account on the docker hub
Commands I used:
dockerfile content:
#Stage 1:
FROM node:latest as node
WORKDIR /app
COPY . .
RUN npm install
RUN npm run build --prod
#Stage: 2
FROM nginx:alpine
COPY --from=node /app/dist/bbbank-ui /usr/share/nginx/html
Create an image
docker build -t {repo pointing to image} -f Dockerfile .
list of images installed:
docker images
list of all containers:
docker ps -a
run a container:
docker run -it --rm -p 8000:80 --name {container-name} {image-name}