metadata:
  name: nodejs-mongo-4x5uh
projects:
  - name: nodejs-mongodb-sample
    source:
      location: >-
        http://devfile-registry-iokhrime-crw3.apps.ocp44.codereadyqe.com/resources/nodejs-mongo-nodejs-mongodb-sample-master.zip
      type: zip
components:
  - id: che-incubator/typescript/latest
    memoryLimit: 512Mi
    type: chePlugin
  - mountSources: true
    endpoints:
      - name: nodejs
        port: 8080
    memoryLimit: 512Mi
    type: dockerimage
    alias: nodejs
    image: >-
      quay.io/crw/stacks-node-rhel8@sha256:880beabedb2f749f83d8d5a78ac9eca8276f6425cd81b8a456532417e3661471
    env:
      - value: 220fd770-c028-480d-8f95-f84353c7d55a
        name: SECRET
      - value: production
        name: NODE_ENV
  - endpoints:
      - name: mongodb-34-rhel7
        port: 27017
        attributes:
          discoverable: 'true'
          public: 'false'
    memoryLimit: 512Mi
    type: dockerimage
    volumes:
      - name: mongo-storage
        containerPath: /var/lib/mongodb/data
    alias: mongo
    image: 'registry.redhat.io/rhscl/mongodb-34-rhel7:1-56'
    env:
      - value: user
        name: MONGODB_USER
      - value: password
        name: MONGODB_PASSWORD
      - value: guestbook
        name: MONGODB_DATABASE
      - value: password
        name: MONGODB_ADMIN_PASSWORD
apiVersion: 1.0.0
commands:
  - name: run the application
    actions:
      - workdir: '${CHE_PROJECTS_ROOT}/nodejs-mongodb-sample'
        type: exec
        command: npm install && node --inspect=9229 app.js
        component: nodejs
  - name: Debug remote node application
    actions:
      - referenceContent: |
          {
          "version": "0.2.0",
          "configurations": [
            {
              "type": "node",
              "name": "Debug (Attach) - Remote",
              "request": "attach",
              "port": 9229
            }]
          }
        type: vscode-launch

