metadata:
  name: nodejs-mongo-bpqh4
projects:
  - name: nodejs-mongodb-sample
    source:
      location: >-
        https://devfile-registry-iokhrime-crw-1.apps.ocp44.crw-qe.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/plugin-java8-rhel8@sha256:719b9cebf5f69be806b99fa409d9b1668c9a8876737d9f0b275618a0101287a2
    env:
      - value: 220fd770-c028-480d-8f95-f84353c7d55a
        name: SECRET
      - value: production
        name: NODE_ENV
  - endpoints:
      - name: mongodb
        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-36-rhel7@sha256:9f799d356d7d2e442bde9d401b720600fd9059a3d8eefea6f3b2ffa721c0dc73
    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

