webksde / ddev-vscode-devcontainer-drupal-template

Drupal DDEV based development container with attached Visual Studio Code
23 stars 3 forks source link

DDEV Drupal Template With Attached VSCode

The tools inside this repository will create a modified Drupal environment, focused on development and debugging.

DO NOT USE IN PRODUCTION - This is a local development tool!

Quick-Start

Spin up a ready-to-code Drupal 10/11 CMS DDEV based development container with preconfigured Drupal Best-Practice Dev-Modules and Visual Studio Code Settings/Extensions in three commands! šŸš€

May take ~5 min - only needed once, at initialization.

Quickly startup a standard dev environment using Drupal 10, meant to be used for testing and working on contrib modules / issues:

git clone https://github.com/webksde/ddev-vscode-devcontainer-drupal-template.git standard-vscode-drupal && cd standard-vscode-drupal && ddev drowl-init

or startup a core dev environment using gitified Drupal 11.x-dev, meant to be used for working on core issues:

git clone https://github.com/webksde/ddev-vscode-devcontainer-drupal-template.git core-vscode-drupal && cd core-vscode-drupal && ddev drowl-init-dev

Tipps:


Features

Provides a plug and play šŸ”Œ DDEV (Docker) based development environment with attached VSCode

Beautifully packaged for easy project and environment switching.

Feel free to fork for other Frameworks or improve for lovely Drupal! ā¤ļø


Prerequisites

  1. Up to date Version of DDEV, Docker, Chrome/Firefox
  2. VSCode installed on your machine locally
  3. The Remote Development Extension for VSCode (extension name: ms-vscode-remote.vscode-remote-extensionpack)
  4. (Optional) To debug inside the attached VS-Code instance, run ddev config global --xdebug-ide-location=container
    1. Unfortunately, this option is only available globally, so you need to adjust your xdebug ide location, when working with other ddev instances, where VSCode is not attached to the web container (e.g., when running the IDE in wsl instead of a container run ddev config global --xdebug-ide-location=wsl2).

How to use

  1. Create a project folder and switch into it: mkdir project-folder && cd project-folder
  2. Clone the repository into the just created folder: git clone git@github.com:webksde/ddev-vscode-devcontainer-drupal-template.git .
  3. Use ddev drowl-init to directly start up the environment using Drupal 10 with VSCode / Drupal Best Practice Tools
  4. You are ready to go! Use ddev describe to check the status & URLs of your Project and ddev code to run your prepared VSCode IDE!
    1. Note, when inside the attached VSCode go to "Extensions" and type in "@recommended" to reveal all the necessary Extensions. Installing them is recommended!

Typical Use-Cases:


Documentation

Tooling

Delete the environment:

  1. ddev delete -y deletes the container and unlists the project.
  2. Delete the project folder

Further ddev Tools and add-ons

FAQ / Troubleshooting:

How do I install ddev?

How do I update dddev?

You can always update ddev using sudo apt update && sudo apt upgrade inside your Ubuntu / WSL istance.

I can not execute the custom "ddev drowl-init" command

I can not reach any url from within the ddev container