master
cn.yimian.xyz 4 years ago
parent 84078e9116
commit 675095c722
  1. 16
      Dockerfile
  2. 11
      pm2.json
  3. 2
      src/index.js

@ -0,0 +1,16 @@
FROM keymetrics/pm2:latest-alpine
# Bundle APP files
COPY src src/
COPY package.json .
COPY pm2.json .
# Install app dependencies
ENV NPM_CONFIG_LOGLEVEL warn
RUN npm install --production
RUN pm2 install pm2-auto-pull
# Show current folder structure in logs
RUN ls -al -R
CMD [ "pm2-runtime", "start", "pm2.json" ]

@ -0,0 +1,11 @@
{
"name": "coro-api",
"script": "src/index.js",
"instances": "2",
"env": {
"NODE_ENV": "development"
},
"env_production" : {
"NODE_ENV": "production"
}
}

@ -78,4 +78,4 @@ app.get('/', async (req, res) => {
/* other */ /* other */
res.send(o); res.send(o);
}); });
Loading…
Cancel
Save