FROM node:alpine as build

WORKDIR /app

COPY package.json package-lock.json ./

RUN npm install

COPY . .

RUN npm run build


FROM node:alpine

WORKDIR /app

COPY --from=build /app/build ./build

COPY package.json package-lock.json ./

RUN npm ci --omit dev

EXPOSE 3000

CMD ["node", "build"]