chore: update Dockerfile and package.json for Node 24 and Yarn 4.17.0; add ecosystem.config.cjs for PM2 management

This commit is contained in:
hexboy 2026-07-01 03:05:05 +03:30
parent c6d334bbe5
commit c4ae2e1c7a
3 changed files with 13 additions and 12 deletions

View file

@ -1,5 +1,5 @@
ARG NODE_VERSION=22.6
ARG ALPINE_VERSION=3.20
ARG NODE_VERSION=24
ARG ALPINE_VERSION=3.24
FROM node:${NODE_VERSION}-alpine${ALPINE_VERSION}
@ -7,7 +7,7 @@ FROM node:${NODE_VERSION}-alpine${ALPINE_VERSION}
ENV NODE_ENV=production
# install and use yarn 4.x
RUN corepack prepare yarn@4.3.1
RUN corepack prepare yarn@4.17.0
# Run as a root user.
USER root
@ -32,4 +32,4 @@ RUN yarn workspaces focus --production && yarn cache clean
EXPOSE 8008
# Run the application.
ENTRYPOINT ["yarn", "run", "pm2", "start", "--attach", "--env", "${NODE_ENV}"]
ENTRYPOINT ["yarn", "run", "pm2", "start", "ecosystem.config.cjs", "--attach", "--env", "$NODE_ENV"]

View file

@ -2,10 +2,10 @@ module.exports = {
apps: [
{
name: 'mmt-server',
script: 'node',
args: 'src/index.ts',
script: 'src/index.ts',
interpreter: 'node',
max_memory_restart: '300M',
env: {
env_production: {
NODE_ENV: 'production',
},
env_development: {

View file

@ -11,11 +11,12 @@
},
"homepage": "https://github.com/hexboy/maven-mirror-tool",
"scripts": {
"dev": "node src/index.ts",
"start": "pm2 start --attach",
"logs": "pm2 logs",
"monit": "pm2 monit",
"stop": "pm2 delete mmt-server",
"dev": "node --watch src/index.ts",
"start": "node src/index.ts",
"pm2:start": "pm2 start ecosystem.config.cjs --attach",
"pm2:logs": "pm2 logs",
"pm2:monit": "pm2 monit",
"pm2:stop": "pm2 delete mmt-server",
"lint": "eslint"
},
"dependencies": {