FROM node:20-alpine

# ENV NODE_ENV=production
ENV APP_PORT=8085
ENV DB_HOST=127.0.0.1
ENV DB_USER=root
ENV DB_PWD=""
ENV DB_DATABASE=4dkankan_motion
ENV REDIS_URL=''
ENV OSS_DOMAIN=https://ossxiaoan.4dage.com
ENV OSS_FOLDER=/helperCenter

WORKDIR /usr/src/app
COPY ./ /usr/src/app

RUN cd ${WORKDIR}
# RUN npm install pnpm -g
RUN npm install pm2 -g
RUN pnpm install
RUN npm run build

EXPOSE ${APP_PORT}

CMD ["pm2-runtime", "ecosystem.config.js"]
# CMD ["npm", "run", "pm2:start"]
