Skip to content

Commit

Permalink
add pm2
Browse files Browse the repository at this point in the history
  • Loading branch information
tagyoureit committed Apr 20, 2024
1 parent f352ca2 commit 8976989
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions .docker/Dockerfile.linux
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ RUN echo "$(ls -al)"
RUN npm ci
RUN npm run build

# Install PM2 globally
RUN npm install pm2 -g

# Second stage for the second application
FROM node:lts-alpine AS build-njspc-dp

Expand All @@ -38,6 +41,9 @@ COPY ./nodejs-poolcontroller-dashpanel ./
RUN npm ci
RUN npm run build

# Install PM2 globally
RUN npm install pm2 -g

# Third stage for the final combined image
FROM node:lts-alpine AS final

Expand All @@ -52,7 +58,7 @@ COPY --from=build-njspc /app/nodejs-poolcontroller ./nodejs-poolcontroller
COPY --from=build-njspc-dp /app/nodejs-poolcontroller-dashpanel ./nodejs-poolcontroller-dashpanel

# Expose any necessary ports
EXPOSE 4200
EXPOSE 4200 5150

# Define the command to run both applications
CMD ["node", "nodejs-poolcontroller/dist/app.js", "&&", "node", "nodejs-poolcontroller-dashpanel/dist/app.js"]
# Define the command to run both applications using PM2
CMD ["pm2-runtime", "start", "/app/nodejs-poolcontroller-dashpanel/ecosystem.config.js", "--", "start", "/app/nodejs-poolcontroller/ecosystem.config.js"]

0 comments on commit 8976989

Please sign in to comment.