FROM node:alpine

WORKDIR /app

ENV PATH /app/node_modules/.bin:$PATH

COPY package.json /app/package.json

RUN rm -rf node_modules/*
RUN rm -rf node_modules/.bin
RUN rm -rf node_modules/.cache
RUN rm -f package-lock.json
RUN npm install typescript @types/react --silent
RUN npm install react-scripts -g --silent
RUN npm install --silent

CMD ["npm", "run", "dev"]
