Skip to content

Instantly share code, notes, and snippets.

@pellizzetti
Created April 30, 2021 14:36
Show Gist options
  • Save pellizzetti/ef92083bed6ff331a9fd15356d486f3a to your computer and use it in GitHub Desktop.
Save pellizzetti/ef92083bed6ff331a9fd15356d486f3a to your computer and use it in GitHub Desktop.
pm2 package example
FROM node:12-alpine AS installer
WORKDIR /home/node/app
COPY package.json yarn.* /home/node/app/
RUN npm pack pm2@4.4.0 && \
tar zxvf pm2-4.4.0.tgz && \
rm pm2-4.4.0.tgz && \
(cd package && yarn install)
COPY . /home/node/app/
FROM dzek69/nodemin:12.14.1-node
USER node
COPY --from=installer --chown=node:node /home/node/app /home/node/app
WORKDIR /home/node/app
EXPOSE 3333
ENTRYPOINT ["/home/node/app/init.sh"]
#!/bin/sh
./package/bin/pm2-runtime process.yml
apps:
- script : server.js
name : server
exec_mode: cluster
instances: max
- script : ace
name : queue
args : bull:listen --board --board-hostname=0.0.0.0 --board-port=9999
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment