FROM node:14.15.4-alpine3.10 AS builder
WORKDIR /usr/src/app
COPY src/community/src ./src
COPY src/community/package.json .
COPY src/community/tsconfig.json .
RUN apk add git
RUN npm install && npm run build

FROM node:14.15.4-alpine3.10
WORKDIR /usr/src/app
COPY --from=builder /usr/src/app/dist ./dist
COPY --from=builder /usr/src/app/node_modules ./node_modules

RUN npm install pm2 -g
CMD ["pm2-runtime", "dist/server.js"]
EXPOSE 3002


