schemaVersion: 2.1.0
metadata:
  name: nodejs-web-app
  namespace: example-codeready
attributes:
  controller.devfile.io/devworkspace-config:
    name: devworkspace-config
    namespace: openshift-operators
  controller.devfile.io/storage-type: per-workspace
projects:
  - git:
      checkoutFrom:
        revision: master
      remotes:
        origin: 'http://10.20.30.40:7990/scm/cfolder/eu-wcs-proxy.git'
    name: eu-wcs-proxy
components:
  - attributes:
      che-code.eclipse.org/contribute-cpuLimit: true
      che-code.eclipse.org/contribute-cpuRequest: true
      che-code.eclipse.org/contribute-endpoint/che-code: 3100
      che-code.eclipse.org/contribute-endpoint/code-redirect-1: 13131
      che-code.eclipse.org/contribute-endpoint/code-redirect-2: 13132
      che-code.eclipse.org/contribute-endpoint/code-redirect-3: 13133
      che-code.eclipse.org/contribute-entry-point: true
      che-code.eclipse.org/contribute-memoryLimit: true
      che-code.eclipse.org/contribute-memoryRequest: true
      che-code.eclipse.org/contribute-volume-mount/checode: /checode
      che-code.eclipse.org/contributed-container: tools
      che-code.eclipse.org/original-memoryLimit: 1G
    container:
      command:
        - /checode/entrypoint-volume.sh
      cpuLimit: 1000m
      cpuRequest: 100m
      endpoints:
        - attributes:
            discoverable: true
            host: wcs-devspace.apps.example.com.local
          exposure: public
          name: apollo
          protocol: https
          targetPort: 8080
        - attributes:
            contributed-by: che-code.eclipse.org
            cookiesAuthEnabled: true
            discoverable: false
            type: main
            urlRewriteSupported: true
          exposure: public
          name: che-code
          path: '?tkn=eclipse-che'
          protocol: https
          secure: false
          targetPort: 3100
        - attributes:
            contributed-by: che-code.eclipse.org
            discoverable: false
            urlRewriteSupported: true
          exposure: public
          name: code-redirect-1
          protocol: http
          targetPort: 13131
        - attributes:
            contributed-by: che-code.eclipse.org
            discoverable: false
            urlRewriteSupported: true
          exposure: public
          name: code-redirect-2
          protocol: http
          targetPort: 13132
        - attributes:
            contributed-by: che-code.eclipse.org
            discoverable: false
            urlRewriteSupported: true
          exposure: public
          name: code-redirect-3
          protocol: http
          targetPort: 13133
      env:
        - name: CHE_DASHBOARD_URL
          value: 'https://devspaces.apps.example.com.local'
        - name: CHE_PLUGIN_REGISTRY_URL
          value: 'https://devspaces.apps.example.com.local/plugin-registry/v3'
        - name: CHE_PLUGIN_REGISTRY_INTERNAL_URL
          value: 'http://plugin-registry.openshift-operators.svc:8080/v3'
      image: 'registry.redhat.io/devspaces/udi-rhel8@sha256:72762feb5ccea26dc7872877b9661fb34a295da05b96581d364c507a4923361e'
      memoryLimit: 6G
      memoryRequest: 4G
      mountSources: true
      sourceMapping: /projects
      volumeMounts:
        - name: m2
          path: /home/user/.m2
        - name: npm
          path: /home/user/.npm
        - name: checode
          path: /checode
    name: tools
  - container:
      args:
        - infinity
      command:
        - sleep
      endpoints:
        - exposure: public
          name: spa
          protocol: https
          targetPort: 4200
      env:
        - name: DEV_MODE
          value: 'true'
      image: 'registry.redhat.io/ubi8/nodejs-14:latest'
      memoryLimit: 4Gi
      mountSources: true
      sourceMapping: /projects
      volumeMounts:
        - name: npm
          path: /home/user/.npm
    name: nodejs-runtime
  - name: npm
    volume:
      size: 1G
  - name: m2
    volume:
      size: 1G
commands:
  - exec:
      commandLine: npm run development
      component: tools
      workingDir: '${PROJECTS_ROOT}/eu-wcs-project-core'
    id: start-project
