Docker multi-stage for Flask + VueJs project Docker multi-stage for Flask + VueJs project flask flask

Docker multi-stage for Flask + VueJs project


The FROM busybox line creates a new image, it doesn't reference the python image. Would just build the js before you build the python so that you can copy the files in when the python build is complete.

FROM node:lts-alpine as build-stageRUN cd ..RUN lsRUN mkdir /frontendWORKDIR /frontendCOPY package*.json ./RUN npm installCOPY . .RUN npm run buildFROM python:3.7-alpine as backend-builderRUN mkdir /appCOPY . /appWORKDIR /appRUN pip install -r requirements.txtCOPY --from=build-stage /frontend/dist /app/dist