1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-21 09:38:01 +02:00

Server: Automatically restarts the server when it crashes, with exponentiel back-off

This commit is contained in:
Laurent Cozic 2023-11-01 16:28:45 +00:00
parent dbd3db873f
commit 0c8b475736
3 changed files with 762 additions and 37 deletions

View File

@ -71,7 +71,7 @@ EXPOSE ${APP_PORT}
# https://github.com/nodejs/docker-node/blob/main/docs/BestPractices.md#handling-kernel-signals # https://github.com/nodejs/docker-node/blob/main/docs/BestPractices.md#handling-kernel-signals
WORKDIR /home/$user/packages/server WORKDIR /home/$user/packages/server
ENTRYPOINT ["tini", "--"] ENTRYPOINT ["tini", "--"]
CMD ["node", "dist/app.js"] CMD ["yarn", "start-prod"]
# Build-time metadata # Build-time metadata
# https://github.com/opencontainers/image-spec/blob/master/annotations.md # https://github.com/opencontainers/image-spec/blob/master/annotations.md

View File

@ -4,7 +4,7 @@
"private": true, "private": true,
"scripts": { "scripts": {
"start-dev": "yarn run build && JOPLIN_IS_TESTING=1 nodemon --config nodemon.json --ext ts,js,mustache,css,tsx dist/app.js --env dev", "start-dev": "yarn run build && JOPLIN_IS_TESTING=1 nodemon --config nodemon.json --ext ts,js,mustache,css,tsx dist/app.js --env dev",
"start-dev-no-watch": "node dist/app.js --env dev", "start-prod": "pm2 kill && pm2 start --no-daemon --exp-backoff-restart-delay=1000 dist/app.js",
"rebuild": "yarn run clean && yarn run build && yarn run tsc", "rebuild": "yarn run clean && yarn run build && yarn run tsc",
"build": "gulp build", "build": "gulp build",
"devCreateDb": "node dist/app.js --env dev --create-db", "devCreateDb": "node dist/app.js --env dev --create-db",
@ -47,6 +47,7 @@
"nodemailer": "6.9.6", "nodemailer": "6.9.6",
"nodemon": "3.0.1", "nodemon": "3.0.1",
"pg": "8.11.3", "pg": "8.11.3",
"pm2": "5.3.0",
"pretty-bytes": "5.6.0", "pretty-bytes": "5.6.0",
"prettycron": "0.10.0", "prettycron": "0.10.0",
"query-string": "7.1.3", "query-string": "7.1.3",

794
yarn.lock

File diff suppressed because it is too large Load Diff