FROM node:lts-alpine as builder COPY ./frontend . RUN npm install RUN npm run build FROM python:3.7.10-stretch as pybuilder WORKDIR /code COPY ./backend /code/ RUN pip install --user -r requirements.txt FROM python:3.7.10-slim-stretch as app COPY --from=pybuilder /root/.local /root/.local COPY --from=pybuilder /code /dist COPY --from=builder ./dist /dist/ WORKDIR /dist EXPOSE 5001 ENTRYPOINT ["python", "/dist/__init__.py"]