Slide 1

Slide 1 text

Local Development Environment for TYPO3 with DDEV Peter Kraume CertiFUNcation Day July 12th, 2019

Slide 2

Slide 2 text

Peter Kraume • Senior TYPO3 Developer at bgm websolutions • Member of the Board of the TYPO3 Association • various TYPO3 community involvement (Content Team, TYPO3camp Munich, TYPO3 Meetup Munich) Twitter: @cybersmog Mail: peter.kraume@bgm-gmbh.de Slides: https://speakerdeck.com/peterkraume

Slide 3

Slide 3 text

Short History of Development Environments • manual local installation of PHP, MySQL and Apache • integrated packages like WAMP, MAMP, XAMPP • virtual machines like VirtualBox or VMWare • containers like Docker All of these solutions require in-depth knowledge or are time consuming to set them up!

Slide 4

Slide 4 text

What is DDEV? • container-based local development environment • based on Docker • creates automatically container for webserver and database • built in support für TYPO3, Drupal, WordPress and Backdrop • open source software • maintained by Drud Technology LLC from Denver, USA • Drud works closely with the TYPO3 Community and TYPO3 GmbH

Slide 5

Slide 5 text

Advantages of DDEV • first of all: you don’t need in-depth knowledge about Docker! • Cross-platform availability • you can import your already existing projects • capable to handle multiple projects at a time • each project can have multiple host names • support for Apache & Nginx and different PHP versions (currently 5.6 - 7.3) • locally trusted SSL out-of-box for every hostname • lots of useful developer tools are already included, like • Git, Composer, npm, yarn, phpMyAdmin, Mailhog, Xdebug • additional containers, e.f for Solr can be connected

Slide 6

Slide 6 text

System Requirements • Operating System • Windows 10 Pro or Enterprise with Docker Desktop for Windows • Windows 10 Home (or other Windows version) with Docker Toolbox • macOS 10.12 Sierra or later with Docker for Mac • Linux: Most Linux distributions which can run Docker-ce are fine. This includes at least Ubuntu 14.04+, Debian Jessie+, Fedora 25+ • Docker 18.06 or higher • docker-compose 1.21.0 and higher

Slide 7

Slide 7 text

Fresh TYPO3 Installation with DDEV mkdir my-typo3-site cd my-typo3-site ddev config --project-type php ddev composer create typo3/cms-base-distribution ^9 --no-interaction --prefer-dist ddev config --project-type typo3 ddev start touch public/FIRST_INSTALL => got to https://my-typo3-site.ddev.site/typo3/ install.php and finish the installation

Slide 8

Slide 8 text

useful DDEV commands ddev list
 => shows all projects ddev remove
 => stop current project - no data is lost! ddev describe
 => show project infos ddev config --php-version 7.3
 => change config without editing the yaml file ddev composer
 => executes composer commands in the web container ddev share
 => share project on the internet via ngrok

Slide 9

Slide 9 text

more DDEV commands ddev exec
 => execute a shell command in the container ddev ssh
 => Starts a shell session in the container ddev import-db --src=dump.sql.gz
 => import DB dumps (sql, sql.gz, tar.gz, zip) ddev logs
 => get the logs from your running services ddev snapshot
 => create a database snapshot ddev restore-snapshot
 => restore a project's database

Slide 10

Slide 10 text

miscellaneous • AdditionalConfiguration.php • if you create a fresh TYPO3 installation, DDEV creates the file for you and already enters the database credentials • for existing projects you need to enter the credentials manually (see ddev describe for the credentials) • individual Docker configuration, e.g. set TYPO3_CONTEXT • .ddev/docker-compose..yaml • install custom debian packages, e.g. PHP modules in the web container • ddev config --webimage-extra-packages=php-yaml • fancy and unlimited: build your own .ddev/web-build/Dockerfile

Slide 11

Slide 11 text

miscellaneous • enable xdebug support: • ddev config —xdebug-enabled • Hooks • can be used to automate setup tasks specific to your project • define them in the project's config.yaml file

Slide 12

Slide 12 text

Help & Documentation • TYPO3 Slack Channel: #ddev
 • Installation: https://ddev.readthedocs.io/en/latest/#installation
 • Bugs: https://github.com/drud/ddev/issues
 • Stack Overflow: https://stackoverflow.com/questions/tagged/ddev
 • Documentation: https://ddev.readthedocs.io/en/latest/
 • Additional Services like Solr:
 https://ddev.readthedocs.io/en/latest/users/extend/additional-services/

Slide 13

Slide 13 text

Thank you! Twitter: @cybersmog Slack: @cybersmog Mail: peter.kraume@bgm-gmbh.de Slides: https://speakerdeck.com/peterkraume This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.