FROM node:alpine AS build
WORKDIR /app
COPY front .
RUN npm install && npm run build

FROM node:alpine
WORKDIR /app
COPY back .
RUN npm install
COPY --from=build /app/dist /app/public
EXPOSE 3000
CMD ["node", "index.js"]