Slide 1

Slide 1 text

@MacMladen Drupal and DDEV advanced workshop v.1 2024-06-12 DRUPAL AND DDEV ADVANCED WORKSHOP Mladen Đurić @MacMladen 1

Slide 2

Slide 2 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 $ whoami 2 A very boring, incompetent guy MLADEN ĐURIĆ a.k.a MacMladen

Slide 3

Slide 3 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 I’ve been in IT since the age of mainframes, 8th year of UNIX epoch. 3

Slide 4

Slide 4 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 I started with Z80 assembly 4

Slide 5

Slide 5 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 I really enjoyed hard core C 5

Slide 6

Slide 6 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 6 As soon as I started learning to code I was so fascinated and wanted to share what I learned. I was hardly into high school when I organised fi rst computer club and gave fi rst BASIC course. It was around 1982. In 2016 I started a Professional Web Development School ]{oder.

Slide 7

Slide 7 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 DDEV 7 Why would I need it when I have the Docker?

Slide 8

Slide 8 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 The tool to manage the container stack DDEV is an open source tool for launching local web development environments in minutes. It supports PHP, Node.js, and Python (experimental). These environments can be extended, version controlled, and shared, so you can take advantage of a Docker work fl ow without Docker experience or bespoke con fi guration. Projects can be changed, powered down, or removed as easily as they’re started. 8

Slide 9

Slide 9 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 INTRODUCE YOURSELF! Do you do the local development? Do you use some tool? (Lando, Docksal, pure Docker, non…) Mac, Windows, Linux? Your experience level? (Basic, regular, advanced) 9

Slide 10

Slide 10 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 TIMETABLE: 1. About workshop ~2 min 2. What is the DDEV ~2 min 3. Docker ~2 min 4. Installation ~2 min 5. Basic commands ~4 min 6. CMS’s ~4 min 7. Con fi guration ~2 min 8. Addons ~1 min 9. Customisation ~1 min 10. The Conclusion ~1 min 11. The Resources ~1 min 12. Q & A 10++ min 10

Slide 11

Slide 11 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 11 Chapter 1 ABOUT WORKSHOP

Slide 12

Slide 12 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 DDEV IS A HUGE ECOSYSTEM Not everything could be covered What we will cover What will be skipped Follow up 12

Slide 13

Slide 13 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 13 Chapter 2 WHAT IS THE DDEV

Slide 14

Slide 14 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 WHY Isolation: enables us to easily manage Docker containers stack which isolates each project in memory and disk, and enables full customisation to match actual production environment. Easy sharing of the environment with code management system (or infrastructure in code) Regularly updated with a lot of out-of-the-box extensions that just work™ 14

Slide 15

Slide 15 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 ALTERNATIVES There are many choices but they all share the same principles: Docksal: FFW team developed solution based on Bash scripts. Lando: Developed by Amaze team to support their infrastructure. Docker4Drupal: Created by Woodby, used for their infrastructure. Docker compose: Docker own solution. DrupalEasy A comparison from 2018: DDEV, Docksal, and Lando 15

Slide 16

Slide 16 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 16 Chapter 3 DOCKER

Slide 17

Slide 17 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 DOCKER DESKTOP 17

Slide 18

Slide 18 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 CONTAINERISATION ALTERNATIVES Install one of the supported Docker providers: OrbStack: Recommended, easiest to install, most performant, commercial, not open- source. Lima: Free, open-source. Docker Desktop: Familiar, popular, not open-source, may require license, may be unstable. Rancher Desktop: Free, open-source, simple installation, slower startup. Colima: Free, open-source, no longer recommended. 18

Slide 19

Slide 19 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 LINUX The least overhead, almost native performance inside container (virtual machine) Linux users are usually very fl uent with command line so tooling, options and basic rules and the way of thinking comes naturally Although many things just work™ some care must be taken (users, permissions, groups, daemon control) 19

Slide 20

Slide 20 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 MAC Being based on FreeBSD, Mac is very similar but still not the same (Mac is UNIX, not Linux) Having different kernel, Mac needs virtualisation to be able to run Linux kernel so inside it can run Linux containers. Also, fi le system is different so we need “smart” mapping (mutagen) which slows down containers Terminal works almost the same On linux it is a system inside a system, on Mac those are inside an another system Mac runs on ARM 64, Apple Silicon Chip while PCs are mostly on Intel/AMD (x86_64) 20

Slide 21

Slide 21 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 WINDOWS Windows is something completely different, running own kernel, different fi le system, everything on different paradigm Having different kernel, Windows needs virtualisation to be able to run Linux kernel so inside it can run Linux containers. Windows uses own WSL2 which runs Ubuntu (Linux) but that has mapping quirks with users and permissions Terminal is totally different (PowerShell) so it is new for average Windows user On linux it is a system inside a system, on Windows those are inside an another system 21

Slide 22

Slide 22 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 22 Chapter 4 DDEV INSTALLATION

Slide 23

Slide 23 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 DDEV INSTALLATION Docker provider DDEV itself Create project 23

Slide 24

Slide 24 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 24 Chapter 5 BASIC COMMANDS

Slide 25

Slide 25 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 SYSTEM COMMANDS ddev help ddev version ddev conf i g ddev describe ddev get ddev list ddev poweroff 25

Slide 26

Slide 26 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 FREQUENT COMMANDS ddev start ddev restart ddev stop ddev delete -O ddev clean -- all ddev hostname 26

Slide 27

Slide 27 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 OPERATIONAL COMMANDS ddev auth ddev ssh ddev composer ddev exec ddev export - db ddev import - db ddev snapshot 27

Slide 28

Slide 28 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 COMMANDS I RARELY USE ddev import - f i les ddev logs ddev mutagen ddev self - upgrade ddev service ddev share 28

Slide 29

Slide 29 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 29 Chapter 6 CMS’s

Slide 30

Slide 30 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 STARTING DRUPAL PROJECT mkdir my - drupal - site & & cd my - drupal - site ddev conf i g - - project - type=drupal - - php - version=8.3 - - docroot=web ddev start ddev composer create drupal/recommended - project:^10 ddev conf i g - - update ddev composer require drush/drush ddev drush site:install - - account - name=admin -- account - pass=admin - y # use the one - time link (CTRL/CMD + Click) from the command below to login. ddev drush uli ddev launch 30

Slide 31

Slide 31 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 STARTING WORDPRESS PROJECT # DDEV has built - in support for WP-CLI, the command - line interface for WordPress. mkdir my - wp - site & & cd my - wp - site # Create a new DDEV project inside the newly - created folder # (Primary URL automatically set to `https: / / .ddev.site`) ddev conf i g -- project - type=wordpress ddev start # Download WordPress ddev wp core download # Launch in browser to f i nish installation ddev launch 31

Slide 32

Slide 32 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 SUPPORTED SYSTEMS Backdrop CakePHP Craft CMS Django 4 (Experimental) Drupal ExpressionEngine Grav Ibexa DXP Kirby CMS Laravel Magento Moodle Pimcore Python/Flask (Experimental) Shopware Silverstripe Statamic Symfony TYPO3 WordPress 32

Slide 33

Slide 33 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 33 Chapter 7 CONFIGURATION

Slide 34

Slide 34 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 .ddev/conf i g.yml name: begaero type: drupal10 docroot: web php_version: "8.2" webserver_type: nginx - fpm xdebug_enabled: false additional_hostnames: [] additional_fqdns: [] database: type: mariadb version: "10.4" use_dns_when_possible: true composer_version: "2" web_environment: [] nodejs_version: "18" corepack_enable: false 34

Slide 35

Slide 35 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 PROJECT TYPE, PHP AND WEB SERVER # name: # Name of the project, automatically provides # http://projectname.ddev.site and https://projectname.ddev.site # type: # backdrop, craftcms, django4, drupal, drupal6, drupal7, laravel, magento, magento2, php, python, shopware6, silverstripe, typo3, wordpress # See https://ddev.readthedocs.io/en/stable/users/quickstart/ for more # information on the different project types # "drupal" covers recent Drupal 8+ # docroot: # Relative path to the directory containing index.php. # php_version: "8.2" # PHP version to use, "5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3" # You can explicitly specify the webimage but this # is not recommended, as the images are often closely tied to DDEV's' behavior, # so this can break upgrades. # webimage: # nginx/php docker image. 35

Slide 36

Slide 36 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 DATABASE AND DEBUG # database: # type: # mysql, mariadb, postgres # version: # database version, like "10.11" or "8.0" # MariaDB versions can be 5.5-10.8 and 10.11, MySQL versions can be 5.5-8.0 # PostgreSQL versions can be 9-16. # router_http_port: # Port to be used for http (defaults to global configuration, usually 80) # router_https_port: # Port for https (defaults to global configuration, usually 443) # xdebug_enabled: false # Set to true to enable Xdebug and "ddev start" or "ddev restart" 36

Slide 37

Slide 37 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 37 Chapter 8 ADDONS

Slide 38

Slide 38 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 ADDING OFFICIAL AND OTHER ADDING ddev get -- list ┌──────────────────────────────────────┬────────────────────────────────────────────────────┐ │ ADD-ON │ DESCRIPTION │ ├──────────────────────────────────────┼────────────────────────────────────────────────────┤ │ ddev/ddev - adminer │ Adminer service for DDEV* │ ├──────────────────────────────────────┼────────────────────────────────────────────────────┤ │ ddev/ddev - beanstalkd │ Beanstalkd for DDEV* │ ├──────────────────────────────────────┼────────────────────────────────────────────────────┤ │ .. . │ ... │ 20 repositories found. Add - ons marked with '*' are off i cially maintained DDEV add - ons. # Getting phpMyAdmin ddev get ddev/ddev - phpmyadmin 38

Slide 39

Slide 39 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 39 Chapter 9 CUSTOMISATION

Slide 40

Slide 40 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 USER (SYSTEM WIDE) 40

Slide 41

Slide 41 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 PROJECT 41

Slide 42

Slide 42 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 GOING EVEN FURTHER 42

Slide 43

Slide 43 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 43 Chapter 13 (secret bonus) TROUBLESHOOTING

Slide 44

Slide 44 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 USEFUL TIPS Clean unused projects and images, they eat disk for treat! Check occasionally Docker logs Mind the context for the commands! Pulling the fi les from provider requires restarting the project 44

Slide 45

Slide 45 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 45 Chapter 10 THE CONCLUSION

Slide 46

Slide 46 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 THE RIGHT TOOL FOR THE JOB Do not reinvent or struggle, just use it and do your work Other tools are quite fi ne and very similar, however, my opinion and the result of my research is that DDEV has wide support, capabilities and many developers using it and contributing DDEV offers all the most important tools already baked in, supports wide variety of options and customisation Supports wide choice of platforms and unsupported can be added easily 46

Slide 47

Slide 47 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 47 Chapter 11 THE RESOURCES

Slide 48

Slide 48 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 ORIGINAL DDEV DOCUMENTATION 48

Slide 49

Slide 49 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 VARIOUS OFFICIAL RESOURCES 49

Slide 50

Slide 50 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 Q & A Mladen Đurić @MacMladen 50

Slide 51

Slide 51 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 THANKS! Mladen Đurić @MacMladen 51

Slide 52

Slide 52 text

@MacMladen ]{ Drupal and DDEV advanced workshop v.1 2024-06-12 52