FROM node:15.3.0

WORKDIR /app

COPY package*.json lerna.json ./
COPY packages/server/package*.json ./packages/server/
COPY packages/client/package*.json ./packages/client/

RUN npm install 
RUN npm run bootstrap:production

COPY . .
COPY .env packages/server/.env

RUN npm run build

EXPOSE 3000
ENV NODE_ENV=production
CMD [ "node", "packages/server/build/index.js" ]
