# Stage 1: NOTE: context is actually ../
FROM node:13.8-alpine AS sources

RUN apk --no-cache add yarn
  
WORKDIR /app

ADD ./qmi-cloud-cli ./
ADD ./qmi-cloud-common ../qmi-cloud-common

RUN yarn install --production

# Stage 2: 
FROM node:13.8-alpine AS production
WORKDIR /app
COPY --from=sources /app ./

RUN chmod a+x ./shell-utils/*.sh

ENTRYPOINT ["sh", "/app/shell-utils/check.sh"]

