Skip to content

Instantly share code, notes, and snippets.

@svor
Created December 12, 2024 14:05
Show Gist options
  • Save svor/6c614522c29794d2f98002506f786ffc to your computer and use it in GitHub Desktop.
Save svor/6c614522c29794d2f98002506f786ffc to your computer and use it in GitHub Desktop.
schemaVersion: 2.2.2
metadata:
name: nodejs-fullstackdemoapplication
components:
- name: nodejs
container:
image: registry.redhat.io/devspaces/udi-rhel8:3.16
env:
# The values below are used to set up the environment for running the application
- name: SECRET
value: 220fd770-c028-480d-8f95-f84353c7d55a
- name: NODE_ENV
value: production
endpoints:
- exposure: public
name: nodejs
targetPort: 8080
protocol: https
memoryRequest: '512Mi'
cpuLimit: '2'
cpuRequest: '1'
mountSources: true
volumeMounts:
- name: npm
path: /home/user/.npm
- name: npm
volume:
size: 1G
- name: mongo
container:
image: registry.redhat.io/rhscl/mongodb-36-rhel7:1-50
env:
- name: MONGODB_USER
value: user
- name: MONGODB_PASSWORD
value: password
- name: MONGODB_DATABASE
value: guestbook
- name: MONGODB_ADMIN_PASSWORD
value: password
endpoints:
- name: mongodb
exposure: public
targetPort: 27017
memoryLimit: '512Mi'
memoryRequest: '256Mi'
cpuLimit: '1'
cpuRequest: '0.25'
mountSources: false
volumeMounts:
- name: mongo-storage
path: /var/lib/mongodb/data
- name: mongo-storage
volume:
size: 1G
- name: redis
container:
image: redis:latest
memoryLimit: 512Mi
endpoints:
- name: redis
targetPort: 6379
commands:
- id: 1-run
exec:
label: "Run the application"
component: nodejs
workingDir: ${PROJECTS_ROOT}/demofullstackapplication
commandLine: "npm install && node --inspect=9229 app.js"
group:
kind: run
- id: start-redis
exec:
component: redis
commandLine: redis-server --port 6379
workingDir: /
group:
kind: run
isDefault: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment