FROM node:14.17.6-stretch-slim as BUILD_IMAGE # python version in this container is 3.5.3 RUN useradd -ms /bin/bash mc WORKDIR /home/mc RUN apt update # for testing with headless chrome browser RUN apt install -y wget RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb RUN apt install -y ./google-chrome-stable_current_amd64.deb WORKDIR /home/mc/mc_frontend COPY package.json . RUN npm install ## use multi-stage image to reduce Docker image size #FROM python:3.8-slim as PYTHON_IMAGE #WORKDIR /home/mc/mc_frontend #RUN apt update #RUN apt install -y git #COPY update_version.py . #COPY src src #RUN python3 update_version.py FROM node:14.17.6-stretch-slim WORKDIR /home/mc/mc_frontend COPY --from=BUILD_IMAGE /home/mc/mc_frontend/node_modules node_modules # to get the version of the local CLI package, run: npm list @angular/cli | sed 's/[^0-9.]*//g' | sed -n 2p RUN npm i -g @angular/cli # this makes the analytics prompt during upcoming "npm install" disappear, so this can also run in CI RUN ng analytics off COPY . . #COPY --from=PYTHON_IMAGE /home/mc/mc_frontend/src/version.ts src/version.ts COPY ./config.xml ./www/config.xml # workaround to fix the missing binding issue for node-sass RUN npm rebuild node-sass # initialize the version file, it will get updated later RUN echo "export const version = '';" | tee src/version.ts