| 123456789101112131415161718 |
- # Step 1: Build the app in image "builder"
- FROM node:lts-alpine AS builder
- COPY package.json package-lock.json ./
- RUN npm i && mkdir /app && mv ./node_modules ./app
- WORKDIR /app
- COPY . .
- RUN npm run build --prod
- # Step 2: Use build output from 'builder'
- FROM nginx:stable-alpine
- LABEL version="1.0"
- COPY ./nginx/nginx.conf /etc/nginx/nginx.conf
- WORKDIR /usr/share/nginx/html
- COPY --from=builder /app/dist/plant-viewer/ .
|