Files
prezentacija-komponiranje/frontend/Dockerfile
2024-01-16 16:45:08 +01:00

21 lines
377 B
Docker

# stage 1: build node frontend
FROM node:21 as node-builder
WORKDIR /node-builder
COPY ./package.json .
COPY ./package-lock.json .
COPY ./public ./public
COPY ./src ./src
RUN \
npm install && \
npm run build
# stage 2: build final image
FROM nginx:1.25-alpine
COPY --from=node-builder /node-builder/build/. /usr/share/nginx/html
RUN ls -alF /usr/share/nginx/html