FROM node:14-alpine

RUN apk --no-cache add make

WORKDIR /app/bot
COPY ./bot/package.json .
RUN npm install

WORKDIR /app/shared
COPY ./shared/package.json .
RUN npm install

WORKDIR /app

COPY ./bot bot
COPY ./shared shared
COPY ./Makefile Makefile

RUN make build_bot

WORKDIR /app/bot

EXPOSE 3000
CMD npm run start