Devfile.yaml for remote dev environment laravel keeps failing

Hey there! To run a laravel app I am trying to get a Dev Environment going. Im not really awesome at containers and docker so Ive been puzzling with this an entire day.  I am using the standard Laravel devfile at and Ive added the attributes that the documentation needs like Username, space.instanceType etc…

I have the devfile.yaml below (I have changed the username and as password I use my Personal Permanent Token (?). 

It accepts it as a valid file and starts booting up, but then it errors out with this message: Failed to start: A critical dev environment process exited with error code 1. What to do, and does anyone have a working devfile.yaml I could work with because this is driving me bonkers :D Thanks  

schemaVersion: 2.2.0
  name: php-laravel
  displayName: Laravel
  description: "Laravel is an open-source PHP framework, which is robust and easy to understand.
    It follows a model-view-controller design pattern.
    Laravel reuses the existing components of different frameworks which helps in creating a web application.
    The web application thus designed is more structured and pragmatic."
    - PHP
    - Composer
    - Laravel
  projectType: Laravel
  language: PHP
  provider: Red Hat
  version: 2.0.0
  - name: php-laravel-starter
        revision: main
    # regular, large, xlarge
    instanceType: regular
    # a default IDE for the project
      # (Required) IDE type: Idea, WebStorm, PyCharm,
      # RubyMine, CLion, Fleet, GoLand, PhpStorm
      type: PhpStorm
      version: '2023.3'
      # Space uses JetBrains Toolbox App to install IDEs to a dev environment.
      # updateChannel defines IDE version release stage: Release, EAP
      updateChannel: EAP
      # JVM configuration (appends to the default .vmoptions file)
        - '-Xms2048m'
        - '-Xmx4096m'
      # (Required) the name of the environment variable
      # that will be available in the dev environment
      - name: USERNAME
        description: 'MY USERNAME'
      - name: PASSWORD
  - container:
        - name: http-laravel
          targetPort: 8000
      args: ["tail", "-f", "/dev/null"]
      memoryLimit: 1024Mi
      mountSources: true
    name: runtime
  - exec:
      commandLine: composer install
      component: runtime
        isDefault: false
        kind: build
      workingDir: ${PROJECT_SOURCE}
    id: install
  - exec:
      commandLine: cp .env.example .env
      component: runtime
        isDefault: false
        kind: build
      workingDir: ${PROJECT_SOURCE}
    id: cp-env
  - exec:
      commandLine: php artisan config:clear
      component: runtime
        isDefault: false
        kind: build
      workingDir: ${PROJECT_SOURCE}
    id: clear-config
  - exec:
      commandLine: php artisan key:generate
      component: runtime
        isDefault: false
        kind: build
      workingDir: ${PROJECT_SOURCE}
    id: gen-new-app-key
  - exec:
      commandLine: composer dump-autoload
      component: runtime
        isDefault: false
        kind: build
      workingDir: ${PROJECT_SOURCE}
    id: composer-dump
  - composite:
        - install
        - cp-env
        - clear-config
        - gen-new-app-key
        - composer-dump
        isDefault: true
        kind: build
      label: Provision Laravel Server
      parallel: false
    id: init-server
  - exec:
      commandLine: php artisan serve --host=
      component: runtime
        isDefault: true
        kind: run
      workingDir: ${PROJECT_SOURCE}
    id: run
1 comment

From what I understand, we cannot use any devfile.yaml, even if it is version 2.2.0. 
At this point, Space does not support several attributes, such as "commands", some within the metadata, etc. 
I took the Dockerfile from the Space documentation and made some updates to be able to build it. (

You can use the Dockerfile directly in devenv.yaml, but in my tests, it takes 6 minutes to build every time I open the IDE. 
If you create an image with the Dockerfile, publish it in your project's Packages, and use this image in the devfile.yaml, it takes 1:30, as you don't need to build it every time. (

I used warm-up on both devfiles, but I didn't see any time improvement; I must be doing something wrong. 

You can use the default Space image, which is much faster to launch (30 seconds). 
But you will have to install/update packages every time you start the IDE. 

I'm currently using my custom image.

To start Laravel, I used sail: 

composer install

npm install

./vendor/bin/sail up 

And I redirected ports to access port 80 of the Dev Environment, through a random port generated by the IDE.


Please sign in to leave a comment.