diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/mi-gateway/Dockerfile | 16 | ||||
-rw-r--r-- | apps/mi-gateway/package.json | 11 | ||||
-rw-r--r-- | apps/mi-gateway/server.js | 31 | ||||
-rw-r--r-- | apps/mi-processor/Dockerfile | 16 | ||||
-rw-r--r-- | apps/mi-processor/package.json | 11 | ||||
-rw-r--r-- | apps/mi-processor/server.js | 31 |
6 files changed, 116 insertions, 0 deletions
diff --git a/apps/mi-gateway/Dockerfile b/apps/mi-gateway/Dockerfile new file mode 100644 index 0000000..dbb042d --- /dev/null +++ b/apps/mi-gateway/Dockerfile @@ -0,0 +1,16 @@ +FROM node:8 + +WORKDIR /opt + +COPY package*.json ./ + +RUN apt update && apt -y full-upgrade +RUN apt install -y postgresql-client +RUN npm install +# If you are building your code for production +# RUN npm ci --only=production + +COPY . . + +EXPOSE 8080 +CMD [ "npm", "start" ] diff --git a/apps/mi-gateway/package.json b/apps/mi-gateway/package.json new file mode 100644 index 0000000..2deee39 --- /dev/null +++ b/apps/mi-gateway/package.json @@ -0,0 +1,11 @@ +{ + "name": "mi-gateway", + "version": "1.0.0", + "main": "server.js", + "scripts": { + "start": "node server.js" + }, + "dependencies": { + "express": "^4.16.1" + } +} diff --git a/apps/mi-gateway/server.js b/apps/mi-gateway/server.js new file mode 100644 index 0000000..4d2546f --- /dev/null +++ b/apps/mi-gateway/server.js @@ -0,0 +1,31 @@ +'use strict'; + +const express = require('express'); + +const PORT = 8080; +const HOST = '0.0.0.0'; + +const app = express(); +app.get('/', (req, res) => { + res.send('mi-gateway 2\n'); +}); + +app.listen(PORT, HOST); +console.log(`Running on http://${HOST}:${PORT}`); + +var keys = []; +for(var key in process.env) { + if (key.startsWith("npm")) { + continue; + } + + keys[keys.length] = key; +} +keys.sort() + +console.log("ENV"); +for (var idx in keys) { + const key = keys[idx]; + const value = process.env[key]; + console.log(" " + key + "=" + value); +} diff --git a/apps/mi-processor/Dockerfile b/apps/mi-processor/Dockerfile new file mode 100644 index 0000000..dbb042d --- /dev/null +++ b/apps/mi-processor/Dockerfile @@ -0,0 +1,16 @@ +FROM node:8 + +WORKDIR /opt + +COPY package*.json ./ + +RUN apt update && apt -y full-upgrade +RUN apt install -y postgresql-client +RUN npm install +# If you are building your code for production +# RUN npm ci --only=production + +COPY . . + +EXPOSE 8080 +CMD [ "npm", "start" ] diff --git a/apps/mi-processor/package.json b/apps/mi-processor/package.json new file mode 100644 index 0000000..2deee39 --- /dev/null +++ b/apps/mi-processor/package.json @@ -0,0 +1,11 @@ +{ + "name": "mi-gateway", + "version": "1.0.0", + "main": "server.js", + "scripts": { + "start": "node server.js" + }, + "dependencies": { + "express": "^4.16.1" + } +} diff --git a/apps/mi-processor/server.js b/apps/mi-processor/server.js new file mode 100644 index 0000000..8b7c9d8 --- /dev/null +++ b/apps/mi-processor/server.js @@ -0,0 +1,31 @@ +'use strict'; + +const express = require('express'); + +const PORT = 8080; +const HOST = '0.0.0.0'; + +const app = express(); +app.get('/', (req, res) => { + res.send('mi-processor\n'); +}); + +app.listen(PORT, HOST); +console.log(`Running on http://${HOST}:${PORT}`); + +var keys = []; +for(var key in process.env) { + if (key.startsWith("npm")) { + continue; + } + + keys[keys.length] = key; +} +keys.sort() + +console.log("ENV"); +for (var idx in keys) { + const key = keys[idx]; + const value = process.env[key]; + console.log(" " + key + "=" + value); +} |