Skip to content

Commit

Permalink
Using pm2 in Dockerfile to circumvent record files being deleted in b…
Browse files Browse the repository at this point in the history
…etween each reboot ijn Kubernetes
  • Loading branch information
SoTrx committed Aug 31, 2022
1 parent 5c080b7 commit b013431
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ WORKDIR /app
COPY --from=build /app/dist /app
RUN apk add --no-cache --virtual=.build-deps alpine-sdk python3 yarn \
&& apk add ffmpeg \
&& npm install -g pm2 \
&& yarn set version berry && grep -qF 'nodeLinker' .yarnrc.yml || echo "nodeLinker: node-modules" >> .yarnrc.yml \
&& yarn plugin import workspace-tools \
&& yarn workspaces focus --all --production \
&& apk del .build-deps
CMD ["node", "/app/main.js"]
CMD ["pm2-runtime", "/app/main.js"]

0 comments on commit b013431

Please sign in to comment.