Skip to content
This repository was archived by the owner on Jul 27, 2023. It is now read-only.

Commit fc67941

Browse files
authored
nodejs-express: new kafka template (#698)
Fixes: #692 Related: #695
1 parent fc2f472 commit fc67941

File tree

14 files changed

+1469
-34
lines changed

14 files changed

+1469
-34
lines changed

incubator/nodejs-express/image/project/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Install the app dependencies in a full Node docker image
22
FROM node:12
33

4+
# librdkafka builds against libssl-dev
5+
RUN apt-get update && apt-get install -y libssl-dev && apt-get clean
6+
47
# Copying individual files/folders as buildah 1.9.0 does not honour .dockerignore
58
COPY package*.json /project/
69
COPY *.js /project/
@@ -22,6 +25,9 @@ RUN cd / && tar czf project.tgz project
2225
# Copy the dependencies into a slim Node docker image
2326
FROM node:12-slim
2427

28+
# librdkafka links against libssl
29+
RUN apt-get update && apt-get install -y libssl1.1 && apt-get clean
30+
2531
# Copy project with dependencies
2632
COPY --chown=node:node --from=0 /project.tgz /
2733
RUN tar xf project.tgz && chown -R node:node /project && rm project.tgz

incubator/nodejs-express/image/project/package-lock.json

Lines changed: 62 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

incubator/nodejs-express/image/project/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"@cloudnative/health-connect": "^2.0.0",
1818
"express": "^4.17.1",
1919
"express-pino-logger": "^4.0.0",
20+
"node-rdkafka": "^2.7.4",
2021
"pino": "^5.14.0",
2122
"prom-client": "^12.0.0"
2223
},

incubator/nodejs-express/image/project/server.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ const userApp = require(basePath + getEntryPoint());
7373
app.use('/', userApp({
7474
server: server,
7575
app: app,
76+
log: pino,
7677
}));
7778

7879
app.get('*', (req, res) => {

incubator/nodejs-express/stack.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: Node.js Express
2-
version: 0.4.7
2+
version: 0.4.8
33
description: Express web framework for Node.js
44
license: Apache-2.0
55
language: nodejs
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
lerna-debug.log*
8+
9+
# Diagnostic reports (https://nodejs.org/api/report.html)
10+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
11+
12+
# Runtime data
13+
pids
14+
*.pid
15+
*.seed
16+
*.pid.lock
17+
18+
# Directory for instrumented libs generated by jscoverage/JSCover
19+
lib-cov
20+
21+
# Coverage directory used by tools like istanbul
22+
coverage
23+
*.lcov
24+
25+
# nyc test coverage
26+
.nyc_output
27+
28+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
29+
.grunt
30+
31+
# Bower dependency directory (https://bower.io/)
32+
bower_components
33+
34+
# node-waf configuration
35+
.lock-wscript
36+
37+
# Compiled binary addons (https://nodejs.org/api/addons.html)
38+
build/Release
39+
40+
# Dependency directories
41+
node_modules/
42+
jspm_packages/
43+
44+
# TypeScript v1 declaration files
45+
typings/
46+
47+
# TypeScript cache
48+
*.tsbuildinfo
49+
50+
# Optional npm cache directory
51+
.npm
52+
53+
# Optional eslint cache
54+
.eslintcache
55+
56+
# Optional REPL history
57+
.node_repl_history
58+
59+
# Output of 'npm pack'
60+
*.tgz
61+
62+
# Yarn Integrity file
63+
.yarn-integrity
64+
65+
# dotenv environment variables file
66+
.env
67+
.env.test
68+
69+
# parcel-bundler cache (https://parceljs.org/)
70+
.cache
71+
72+
# next.js build output
73+
.next
74+
75+
# nuxt.js build output
76+
.nuxt
77+
78+
# vuepress build output
79+
.vuepress/dist
80+
81+
# Serverless directories
82+
.serverless/
83+
84+
# FuseBox cache
85+
.fusebox/
86+
87+
# DynamoDB Local files
88+
.dynamodb/
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Appsody: Attach node debugger",
6+
"type": "node",
7+
"request": "attach",
8+
"port": 9229,
9+
"remoteRoot": "/project/user-app",
10+
"localRoot": "${workspaceFolder}",
11+
"protocol": "inspector"
12+
}
13+
]
14+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "Appsody: run",
6+
"type": "shell",
7+
"command": "appsody run",
8+
"group": "build",
9+
"problemMatcher": []
10+
},
11+
{
12+
"label": "Appsody: debug",
13+
"type": "shell",
14+
"command": "appsody debug",
15+
"group": "build",
16+
"problemMatcher": []
17+
},
18+
{
19+
"label": "Appsody: test",
20+
"type": "shell",
21+
"command": "appsody test",
22+
"group": "test",
23+
"problemMatcher": []
24+
},
25+
{
26+
"label": "Appsody: build",
27+
"type": "shell",
28+
"command": "appsody build",
29+
"group": "build",
30+
"problemMatcher": []
31+
},
32+
{
33+
"label": "Appsody: deploy",
34+
"type": "shell",
35+
"command": "appsody deploy",
36+
"group": "build",
37+
"problemMatcher": []
38+
},
39+
{
40+
"label": "Appsody: stop",
41+
"type": "shell",
42+
"command": "appsody stop",
43+
"group": "build",
44+
"problemMatcher": []
45+
}
46+
]
47+
}

0 commit comments

Comments
 (0)