|
|
@ -17,10 +17,10 @@ services:
|
|
|
|
dockerfile: Dockerfile
|
|
|
|
dockerfile: Dockerfile
|
|
|
|
# production: no reason to use pm2 if docker offers auto-restart
|
|
|
|
# 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
|
|
|
|
# development: don't use docker auto-restart; rather pm2, which can watch for file changes
|
|
|
|
#restart: always
|
|
|
|
restart: always
|
|
|
|
user: "node"
|
|
|
|
user: "node"
|
|
|
|
environment:
|
|
|
|
environment:
|
|
|
|
- NODE_ENV=development
|
|
|
|
- NODE_ENV=production
|
|
|
|
volumes:
|
|
|
|
volumes:
|
|
|
|
- ./node/:/home/node/app
|
|
|
|
- ./node/:/home/node/app
|
|
|
|
expose:
|
|
|
|
expose:
|
|
|
@ -29,9 +29,9 @@ services:
|
|
|
|
- postgres
|
|
|
|
- postgres
|
|
|
|
working_dir: /home/node/app
|
|
|
|
working_dir: /home/node/app
|
|
|
|
# for production (no file watching):
|
|
|
|
# for production (no file watching):
|
|
|
|
# command: sh -c "yarn install && node server.js"
|
|
|
|
command: sh -c "yarn install && node server.js"
|
|
|
|
# for development (file watching/reloading):
|
|
|
|
# for development (file watching/reloading):
|
|
|
|
command: sh -c "yarn install && yarn pm2-dev server.js"
|
|
|
|
# command: sh -c "yarn install && yarn pm2-dev server.js"
|
|
|
|
postgres:
|
|
|
|
postgres:
|
|
|
|
image: "postgres:13.1-alpine"
|
|
|
|
image: "postgres:13.1-alpine"
|
|
|
|
environment:
|
|
|
|
environment:
|
|
|
|