pm2 only for dev; production uses docker-compose auto-restart

stable
brian 4 years ago
parent 90f5466317
commit 27861adeb8

@ -15,6 +15,8 @@ services:
build:
context: ./node/
dockerfile: Dockerfile
# production: no reason to use pm2 if docker offers auto-restart
# development: don't use docker auto-restart; rather pm2, which can watch for file changes
#restart: always
user: "node"
environment:
@ -27,7 +29,7 @@ services:
- postgres
working_dir: /home/node/app
# for production (no file watching):
# command: sh -c "yarn install && yarn pm2-runtime server.js"
# command: sh -c "yarn install && node server.js"
# for development (file watching/reloading):
command: sh -c "yarn install && yarn pm2-dev server.js"
postgres:

@ -6,9 +6,11 @@
"repository": "https://git.sakal.us/brian/pastebin-server.git",
"author": "Brian Sakal <brian@sakal.us>",
"license": "MIT",
"devDependencies": {
"pm2": "^4.5.5"
},
"dependencies": {
"express": "^4.17.1",
"pg": "^8.5.1",
"pm2": "^4.5.5"
"pg": "^8.5.1"
}
}

Loading…
Cancel
Save