weitzman / ddev-gitpod

A full Drupal dev environment in a browser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gitpod ready-to-code

ddev + Gitpod

Set up a full Drupal dev environment in a browser

This project demonstrates a complete Drupal 9 development environment, utilizing ddev and Gitpod, through your browser.

Video Demo

Watch a 5 minutes walkthrough video:

Setup a full Drupal dev environment in a browser

Prerequisites:

  1. Sign up for gitpod.io
  2. Check Enable Feature Preview (To allow running docker inside docker)

Try it out:

  1. Click on the following link https://gitpod.io/#https://github.com/shaal/ddev-gitpod
  2. Your environment is being prepared, wait for about 40 seconds (A splash screen will appear with a 3d Gitpod cube)
  3. Theia (or VScode) IDE will be displayed.
  4. Note that one terminal is running sudo docker-up, and another terminal in parallel is running ddev start
  5. ddev will pull all required Docker images.
  6. Find your website's URL gp url 8080
  7. Open your website's URL in a browser, you should see Drupal's installation screen.
  8. Run in terminal ddev drush si demo_umami -y
  9. Open your website's URL in a browser, you should see Drupal's Umami demo.
  10. Run in terminal ddev xdebug on
  11. Open VScode's debugger, place a new breakpoint in web/index.php
  12. Open your website's URL in a browser.
  13. 🎉

Do you like PhpStorm instead of Theia or VScode?

  1. Open a bash window at the bottom
  2. .ddev/run-phpstorm.sh
  3. When it shows you port 9999 is up, click the link and use PhpStorm with this repo.

How does it work?

  1. Gitpod - development environment based on Docker
    1. .gitpod.yml
      1. Defines the main docker image this environment is built on - .gitpod.Dockerfile
      2. Run initial commands using 3 terminals in parallel:
        1. gitpod-setup-ddev.sh
        2. composer install
        3. sudo docker-up
    2. .gitpod.Dockerfile
      1. Set base image to Gitpod's workspace-full (link)
      2. Install ddev using brew
  2. ddev - ridiculously simple setup for complex development environments
    1. .ddev/config.yaml - main ddev (default) configuration, can be generated by running ddev config
    2. .ddev/gitpod-setup-ddev.sh - generate config overrides for ddev to work in the Gitpod environment.
      1. Delete any existing Docker images and containers (due to Gitpod bug, that cause issues when restarting a workspace)
      2. Set certain ports to public, following Gitpod's syntax [port]-[workspace-url]
        1. 8080 - Drupal Website
        2. 8025 - Mailhog
        3. 8036 - PHPmyadmin
      3. Set host.docker.internal with the correct value of gitpod's host ip
      4. Starts ddev

Thank you

@rfay for your endless patience and relentless support that made this project possible.

Known issues:

Future:

About

A full Drupal dev environment in a browser


Languages

Language:PHP 95.2%Language:Shell 3.7%Language:Dockerfile 1.1%