Kickstart drupal development Fodor zoltan (Archy) You, where, what you do fodor18zoltan@gmail.com
FE WEB DEVELOPMENT QA concerns everyone involved with Sys Admin Not about drupal Concerns Web development WEB DEVELOPMENT
PROBLEM? - Might not seem like
Before CODING setting up environment developement testing This part in creating something No real advancement Preparing Test and see how progress
Setting up environment installing services downloading project files configuring all of it -- time consuming -- tedious -- annoying Environment = services + project Example Drupal .. Once then just configure Uncounsciously
Drupal easy 3rd party
1. Service lockdown for all projects on one workstation no containment hard to manage multiple versions possibility of incompatibility Invented term Same serivices Sometimes update Same V for all projects, no easy swap Diff prod env Story
2. REPETITION same configuration done multiple times expands to everyone on the team -- inconsistency -- accumulating time wasted Few variables Team reapates same as you ++services –time Question? Like configuring
3. BEING Unorganized many services on one workstation unused services -- wasted resources: -- processing power, disk space Time passes by ++services Leave projects, services hang Workstation mess Reinstall os Story
SOLution? Problem clear
VIRTUALIZATON What we need? services grouped in self-contained environments environments separated from each other easy and fast ability to have dozens VIRTUALIZATON - Multiple instance same service - Interference Contain Save time Lot of virt software Pick best Kinds to chose?
Hardware virtualization completely separate secure supports any OS -- high resource usage -- large image sizes -- slow installation / bootup - College Virtual box
Os-level virtualization no need to mimic hardware no need for full separate OS system calls to host kernel -- not as secure -- cannot host different OS almost same performance as host small image sizes Example windows !=! Linux Pause, you might have guessed
DOCKEr ! Docker perfect f problems Only basics and benefits Not pro me
DockeR provides container virtualization around since 2013 open source / free to use supported on every major OS - Statement
Docker terms IMAGE filesystem LAYER filesystem difference (shareable) CONTAINER running instance of an image Gotta understand these 3 Image OS needs fs Layer ~ commit
IMAGE vs Container Diff -> why fast start Middle image Inside layers LOCK Container top tiny layer
DOCKErFILE dockerfile ~ commands file image built from dockerfile extend existing images DOCKErFILE Image how Built from Commands FROM -> extending
DOCKEr ClI $ docker build <Dockerfile> $ docker run -v webapp /www/html/ <image> $ docker run -p 80:8080 <image> Example start many Customized upon start $ docker run -e “MY_ENV=foo”<image>
DOCKEr hub repository for images allows sharing/re-using community -> stable
Docker compose CLI wrapper over docker cli ‘container bundles’ = environment Convenience Additional behaviour
HARD TO LEARN Docker what we needed. Easy, fast Question? Uses docker As I see Hard to learn HARD TO LEARN
DRUP Still need to do .. !Story how started Name from Drupal CLI
What it does? download and configure projects build their environments provide easy access to all local projects ... => automate more Centralized system Tiny actions in betw
Environment Project builds upon docker has services => containers service communication service configuration files container configurations Project brings in project files configures project defines environment adds specific services custom service config
CREATING NEW / REGISTERING LOCAL OR REPOSITORY - Terminal form
structure SERVICE CONFIGURATION FILES PERSISTING DATA SERVICE/CONTAINER LOGGING Same for types Docker specific PROJECT ROOT CUSTOM DOCKERFILE-S
Configuration registry project and environment configuration combined => yaml detected and reused on other systems registry projects are tracked identified by unique id Auto env shared conf Global operations
Container Service Access http://localhost:8080 http://localhost:8080 http://localhost:8081 - Port conflicts http://localhost:1337
Hosts aliases $ sudo drup start drupal-test-site Aliases for exposed containers upon start $ docker inspect -f "{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}” <container-id> $ sudo drup start drupal-test-site Long command eh? Easy to remember
Service commands $ docker exec <container-id> drush cr -> started container $ docker run -it -d <container-id> drush cr -> un-started container Shellscript wrappers Service operations $ drup drupal drush cr $ drup drush cr -> from anywhere -> under project directory
1 image 1 service Important bad habit `Each container should have only one concern` Some cases not EZ
Automatic start (un-implemented) Unimplemented feature Office situtation
https://github.com/archfz/drup Drup PROJECT supports Drupal project type PHP-FPM, Apache, NGINX, MariaDB, MySQL, PMA, Node written in JS, runs with NodeJS pre-alpha / open-source https://github.com/archfz/drup
DRUP DEMO
Why use drup? uses docker contains, organizes and keeps track of your projects removes repetition by sharing the configuration fast setup, easy usage kickstarts development
THANK You!
QUESTIONS ?? Sources Google images. https://docs.docker.com/ http://www.zdnet.com/article/what-is-docker-and-why-is-it-so-darn-popular/ https://en.wikipedia.org/wiki/Operating-system-level_virtualization https://www.upguard.com/articles/docker-vs.-vmware-how-do-they-stack-up