Dockerfile 452 B

123456789101112131415161718
  1. # Step 1: Build the app in image "builder"
  2. FROM node:lts-alpine AS builder
  3. COPY package.json package-lock.json ./
  4. RUN npm i && mkdir /app && mv ./node_modules ./app
  5. WORKDIR /app
  6. COPY . .
  7. RUN ./node_modules/@angular/cli/bin/ng build --prod
  8. # Step 2: Use build output from 'builder'
  9. FROM nginx:stable-alpine
  10. LABEL version="1.0"
  11. COPY ./nginx/nginx.conf /etc/nginx/nginx.conf
  12. WORKDIR /usr/share/nginx/html
  13. COPY --from=builder /app/dist/plant-viewer/ .