Skip to content

Commit 601038a

Browse files
committed
feat: introduce nodejs+mongodb devfile
Signed-off-by: Valeriy Svydenko <[email protected]>
1 parent 3fac029 commit 601038a

File tree

2 files changed

+78
-0
lines changed

2 files changed

+78
-0
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
# Node.js stacks
3636
/stacks/nodejs/ @BethGriggs @devfile/che-team
3737
/stacks/nodejs-angular/ @devfile/devfile-services-team @devfile/che-team
38+
/stacks/nodejs-mongodb/ @svor @devfile/che-team
3839
/stacks/nodejs-nextjs/ @devfile/devfile-services-team @devfile/che-team
3940
/stacks/nodejs-nuxtjs/ @devfile/devfile-services-team @devfile/che-team
4041
/stacks/nodejs-react/ @devfile/devfile-services-team @devfile/che-team

stacks/nodejs-mongodb/devfile.yaml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
schemaVersion: 2.2.2
2+
metadata:
3+
name: nodejs-mongodb
4+
displayName: Node.js MongoDB
5+
description: NodeJS web application which communicates with MongoDB
6+
icon: https://github.com/che-samples/nodejs-mongodb-sample/raw/main/nodejs-mongodb.png
7+
tags:
8+
- Node.js
9+
- MongoDB
10+
- ubi9
11+
projectType: universal
12+
language: Polyglot
13+
version: 1.0.0
14+
projects:
15+
- name: nodejs-mongodb-sample
16+
git:
17+
remotes:
18+
origin: 'https://github.com/che-samples/nodejs-mongodb-sample'
19+
checkoutFrom:
20+
revision: main
21+
components:
22+
- name: tools
23+
container:
24+
# quay.io/devfile/universal-developer-image:ubi9-dd1f49f
25+
image: quay.io/devfile/universal-developer-image@sha256:c7ef40c8e6997d8961572a0e9088aec6735b4df0dedae2361085a44260b8c12f
26+
env:
27+
# The values below are used to set up the environment for running the application
28+
- name: SECRET
29+
value: 220fd770-c028-480d-8f95-f84353c7d55a
30+
- name: NODE_ENV
31+
value: production
32+
endpoints:
33+
- exposure: public
34+
name: nodejs
35+
targetPort: 8080
36+
protocol: https
37+
memoryLimit: 1G
38+
mountSources: true
39+
40+
- name: mongo
41+
container:
42+
# bitnami/mongodb:8.0.8
43+
image: bitnami/mongodb@sha256:b3bd5b6be9a0734dfa027c866ba17c42fd4c4325c973669e5e77a354c30e84a3
44+
env:
45+
- name: MONGODB_USERNAME
46+
value: user
47+
- name: MONGODB_PASSWORD
48+
value: password
49+
- name: MONGODB_DATABASE
50+
value: guestbook
51+
- name: MONGODB_ROOT_PASSWORD
52+
value: password
53+
endpoints:
54+
- name: mongodb
55+
exposure: internal
56+
targetPort: 27017
57+
attributes:
58+
discoverable: 'true'
59+
memoryLimit: 512Mi
60+
mountSources: true
61+
volumeMounts:
62+
- name: mongo-storage
63+
path: /bitnami/mongodb
64+
65+
- name: mongo-storage
66+
volume:
67+
size: 256Mi
68+
69+
commands:
70+
- id: run-application
71+
exec:
72+
label: "Run the application"
73+
component: tools
74+
workingDir: ${PROJECT_SOURCE}
75+
commandLine: "npm install && node --inspect=9229 app.js"
76+
group:
77+
kind: run

0 commit comments

Comments
 (0)