Local Development Environment for TYPO3 with DDEV - #t3oce 2020

Local Development Environment for TYPO3 with DDEV - #t3oce 2020

Get your local development environment for TYPO3 up and running within minutes and without deeper Docker knowledge.

C236700abcfe23472d68334d54610451?s=128

Peter Kraume

August 02, 2020
Tweet

Transcript

  1. Local Development Environment for TYPO3 with DDEV Peter Kraume TYPO3

    Online Community Event August 2nd, 2020
  2. 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
  3. 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!
  4. What is DDEV? • container-based local development environment • based

    on Docker • creates automatically container for webserver and database (and more) • built in support für TYPO3, Drupal, Magento, Laravel, WordPress and Backdrop • open source software • maintained by Drud Technology LLC from Denver, USA • Drud is very community driven to adapt DDEV optimally for TYPO3 and the other systems
  5. 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.4) • 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.g. for Solr can be connected
  6. System Requirements • Operating System • Windows 10 (all editions)

    with WSL2 (version 2004 or later) • (Non-WSL2) Windows 10 Home, Pro, or Enterprise with Docker Desktop for Windows • macOS 10.13 High Sierra or later with Docker for Mac • Linux: Most Linux distributions which can run Docker-ce are fine. This includes at least Ubuntu 16.04+, Debian Jessie+, Fedora 25+ • Docker 18.06 or higher • docker-compose 1.21.0 and higher
  7. Getting Started • Install Docker • Install DDEV • Get

    a SSH client It’s all pretty good documented! The link to the documentation is on the „ Help & Documentation“ slide at the end.
  8. Fresh TYPO3 Installation with DDEV mkdir my-typo3-site && cd my-typo3-site

    ddev config --project-type=typo3 --docroot=public --create-docroot=true ddev composer create typo3/cms-base- distribution:"10.4" --prefer-dist ddev start touch public/FIRST_INSTALL && ddev launch typo3/ install.php Finish the installation
  9. Useful DDEV commands ddev list => shows all projects ddev

    stop => stop current project - no data is lost! ddev poweroff => stop all projects - 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
  10. More DDEV Commands ddev exec [command] => 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
  11. Delete DDEV project ddev delete -O => deletes the containers

    and database data. => The code and its .ddev directory will not be touched. => Afterwards you can delete the project folder.
  12. 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) • enable xdebug support: • ddev xdebug on
  13. Extending DDEV • Extending and Customizing Environments • e.g. PHP

    version, webserver type, custom environment variables, web server settings • Additional Services • e.g. Solr, Redis, Blackfire.io • Defining Custom Services with Docker Compose • e.g. to set the TYPO3_CONTEXT • Customizing Docker Images • e.g. add further PHP Modules like php-yaml • Custom Commands • Global or project specific commands to run either on the host or in a container • In-container Configuration • e.g. custom Git or SSH configuration • Hooks • can be used to automate setup tasks specific to your project • define them in the project's config.yaml file
  14. Help & Documentation • TYPO3 Slack Channel: #ddev • Installation:

    https://ddev.readthedocs.io/en/latest/#installation • Tutorial: https://typo3.com/blog/tutorial-get-a-local-typo3-v10-installation- with-no-effort • Bugs: https://github.com/drud/ddev/issues • Stack Overflow: https://stackoverflow.com/questions/tagged/ddev • Documentation: https://ddev.readthedocs.io/en/latest/
  15. 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.