########### DEV IMAGE ##########
FROM node:12.4.0-alpine as dev

RUN mkdir /app/
WORKDIR /app/

# package.json is the only one will be changed when new dependency added
COPY ./src/package.json /app/package.json
RUN npm install

COPY ./src/ /app/

############ PROD IMAGE ##############
FROM dev as prod

CMD node .