docker tweaks for fast setup on UAT

pull/4/head
Jose Vera 2022-03-02 18:46:03 -05:00
parent 16b6256367
commit 9d14157621
6 changed files with 14 additions and 23 deletions

View File

@ -6,9 +6,10 @@ WORKDIR /app
# Install app dependencies
COPY package*.json ./
RUN npm ci
RUN npm install pm2 -g
# Bundle app source
COPY . .
EXPOSE 3000
CMD [ "node", "--es-module-specifier-resolution=node", "server.js" ]
CMD ["pm2-runtime", "ecosystem.config.js"]

View File

@ -8,16 +8,8 @@ services:
volumes:
- ./:/app
ports:
- "80:3000"
- "3000:3000"
- "4040:4040"
worker:
build: .
command: node --es-module-specifier-resolution=node worker.js
restart: unless-stopped
depends_on:
- db
volumes:
- ./:/app
db:
image: postgres
restart: always

View File

@ -1,10 +1,9 @@
export default {
apps: [{
name: 'Retropilot Service',
script: './server.js',
env_development: {
NODE_ENV: 'development',
},
}],
};
module.exports = [{
script: 'server.js',
name: 'server',
node_args: '-r esm',
}, {
script: 'worker.js',
node_args: '-r esm',
name: 'worker'
}]

View File

@ -3,7 +3,6 @@
"version": "1.0.0",
"description": "replacement for comma.ai backend and useradmin dashboard. can be combined with a modified cabana instance.",
"main": "server.js",
"type": "module",
"scripts": {
"test": "mocha",
"start": "node --es-module-specifier-resolution=node server.js",
@ -62,4 +61,4 @@
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-no-floating-promise": "^1.0.2"
}
}
}

View File

@ -2,7 +2,7 @@ import express from 'express';
import crypto from 'crypto';
import dirTree from 'directory-tree';
import bodyParser from 'body-parser';
import deviceSchema from '../../schema/routes/devices.mjs';
import deviceSchema from '../../schema/routes/devices';
import deviceController from '../../controllers/devices';
import authenticationController from '../../controllers/authentication';