FROM node

WORKDIR /app

#only copy package,json so that install step is cached
COPY bref-solutions/.npmrc bref-solutions/package*.json ./

#install packages
RUN npm ci

#delete npmrc from image
RUN rm -f .npmrc

#copy rest of files
COPY bref-solutions /app

#add ng command to path
ENV PATH "/app/node_modules/.bin:${PATH}"

#docker image build will fail if tests fail
RUN ng test