How to #dockerize an #angular Project in 2 Minutes!
STEPS :
1)
FROM node:14-alpine as build
WORKDIR /app
COPY package*json ./
RUN npm install
COPY . .
RUN npm run build --prod
FROM nginx:1.21.0-alpine
RUN rm -rf /usr/share/nginx/html/*
COPY --from=build /app/dist/* /usr/share/nginx/html
EXPOSE 80
CMD ["nginx","-g","daemon off;"]
2) docker build -t my-angular-project .
3) docker run -p 8080:80 my-angular-project
Ещё видео!