FROM keymetrics/pm2:8-alpine

ENV TERM=xterm


# RUN pm2 -V
RUN apk --no-cache update \ 
&& apk --no-cache add g++ make bash zlib-dev libpng-dev \
&&  rm -fr /var/cache/apk/*

RUN apk add --no-cache curl

RUN apk add --no-cache bash

RUN apk add --no-cache yarn

CMD cd /home/app/nextjs && yarn cache dir && yarn cache clean && yarn install && yarn build && pm2 startOrReload ecosystem.config.js --env production --no-daemon

