schemaVersion: 2.1.0
metadata:
  name: python-hello-world
  namespace: fsiliberto-codeready
attributes:
  controller.devfile.io/devworkspace-config:
    name: devworkspace-config
    namespace: openshift-operators
  controller.devfile.io/storage-type: per-workspace
projects:
  - name: python-hello-world
    zip:
      location: 'http://devfile-registry.openshift-operators.svc:8080/resources/v2/python-hello-world.zip'
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: python
      che-code.eclipse.org/original-memoryLimit: 2G
    container:
      command:
        - /checode/entrypoint-volume.sh
      cpuLimit: 500m
      cpuRequest: 30m
      endpoints:
        - 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.enxctrmapp.ccg.local'
        - name: CHE_PLUGIN_REGISTRY_URL
          value: 'https://devspaces.apps.enxctrmapp.ccg.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: 3.07G
      memoryRequest: 256Mi
      mountSources: true
      sourceMapping: /projects
      volumeMounts:
        - name: m2
          path: /home/user/.m2
        - name: npm
          path: /home/user/.npm
        - name: venv
          path: /home/user/.venv
        - name: checode
          path: /checode
    name: python
  - 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
  - container:
      args:
        - tail
        - '-f'
        - /dev/null
      endpoints:
        - exposure: public
          name: nginx
          protocol: https
          targetPort: 8081
      image: 'nginxinc/nginx-unprivileged:latest'
      mountSources: true
      sourceMapping: /projects
    name: nginx
  - name: npm
    volume:
      size: 1G
  - name: m2
    volume:
      size: 1G
  - name: venv
    volume:
      size: 1G
commands:
  - exec:
      commandLine: python -m venv .venv && . .venv/bin/activate && python hello-world.py
      component: python
      group:
        kind: run
      label: Run the application
      workingDir: '${PROJECTS_ROOT}/python-hello-world'
    id: run
