From 95ba1f213340730b814a9a744024e619082c551d Mon Sep 17 00:00:00 2001 From: "usa.yimian.xyz" Date: Mon, 15 Mar 2021 00:25:41 -0400 Subject: [PATCH] docker --- Dockerfile | 15 +++++++++++++++ pm2.json | 12 ++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 Dockerfile create mode 100644 pm2.json diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..43f5b69 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +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 + +# Show current folder structure in logs +RUN ls -al -R + +CMD [ "pm2-runtime", "start", "pm2.json" ] diff --git a/pm2.json b/pm2.json new file mode 100644 index 0000000..2816ca8 --- /dev/null +++ b/pm2.json @@ -0,0 +1,12 @@ +{ + "name": "wIoT-director", + "script": "src/index.js", + "restart_delay": 43200000, + "instances": "1", + "env": { + "NODE_ENV": "development" + }, + "env_production" : { + "NODE_ENV": "production" + } +}