BASICS THE WORLD OF DOCKER 4 / When talking about Docker people often assume two things: / Docker invented containers / Containers are virtual machines
BASICS THE WORLD OF DOCKER 7 / When talking about Docker people often assume two things: / Docker invented containers / Containers are virtual machines / Docker builds on the fundaments of the Linux kernel / Container = Isolated processes with their resources / Image = the template for a container. Source: wikipedia.org
BASICS TOOL AND INFRASTRUCTURE 8 / Docker is a tool and an infrastructure / Create and manage images and containers in a standardized way / Distribute your images / Tag them for different versions / Inspect and access your containers in a standardized way / Build upon existing images
THE DEV ENVIRONMENT TEN YEARS AGO 10 / What options did we have back in the day? / Install a XAMPP Stack on the local machine and configure it by hand / Install the dev environment on a global server and let the developers loose on it / Put it all in a virtual machine (Vagrant)
SO? WHATS WRONG WITH THAT? 11 / Simulate the network part / Handing over the project to the juniors / Multiple users work on the same project? / Working from remote? / Sync changes, keep the database up to date / Keep the versions of the software up to date / Wasting resources and time
A NEW FOUNDATION BASED ON DOCKER 12 / Lets make a dev environment that is / Run, setup and maintained in a uniform way across machines (even operating systems) / Responsibly handling our resources / Easy to extend and built upon / Fun to use
STANDARDIZE THE DEV ENVIRONMENT WHAT DO WE NEED? 14 / We want to run Shopware, so / We need a web server to handle our request / We need a PHP FPM instance we can talk to / Database
STANDARDIZE THE DEV ENVIRONMENT OVERVIEW 15 / With SSL / With a host configured to serve a Shopware installation / With IONCUBE / XDEBUG / BlackFire / Nothing special for now, just a database
STANDARDIZE THE DEV ENVIRONMENT PUTTING IT ALL TOGETHER 16 Docker-compose / Start our containers / Link the networks of the containers together / Mount the file system
STANDARDIZE THE DEV ENVIRONMENT BONUS: THE SMALL THINGS (MIGRATIONS, CACHING ETC.) 17 / How to make sure that the migrations are run and other important jobs are run when we start our development environment? / What about varnish, elastic search etc?
STANDARDIZE THE DEV ENVIRONMENT 18 / What we have done so far / Talked about a list of basic containers we need to run a Shopware instance / Briefly covered small adjustments that could have been made / How to wire it up and get it running
TAKING IT A STEP FURTHER SIMPLE, SINGLE PURPOSE, REUSABLE 20 / Software engineering knows a lot of principles and best practices / DRY - Don't repeat yourself / Single Responsibility Principle / Rule of three / … / Create simple single purpose containers and stack them
TAKING IT A STEP FURTHER PHP 25 / Every stage adds one or more distinct features 7-ubuntu-vanilla 7-ubuntu-dev 7-ubuntu- shopware XDEBUG IonCube Libs BlackFire User
TAKING IT A STEP FURTHER WHAT YOU CAN DO NOW 26 / Get new projects up and running in no time no matter if its a Shopware project or not / Have simple separated containers for multiple purposes
ON TO DEPLOYMENT A PRIMER: HOW WE DO DEPLOYMENTS / Based on shipit / Used to run composer and other commands and sync those to the remote server / We don’t want that on our computer or target environment! Lets put it in a container. / Enables the One-Click Deployment
ON TO DEPLOYMENT 30 / Okay you can sync files, what else can you do for me? / What do you think about getting the newest database dump? / What about our S3 buckets? / Did you say tests?
ON TO DEPLOYMENT INTEGRATING CONTINUOUS INTEGRATION 35 / Now that we have unit tests and the deployment neatly isolated we can organize them in a deployment pipeline / The same goes for data syncing
ON TO DEPLOYMENT SUMMARY 36 / Now you are able to make use of your reusable images to improve your workflow: / Create containers for deployment / Create containers to run your syncing commands / Create containers for unit testing / Organize them in workflows to automate tasks like data sync across development environments
SUMMARY 39 / We started out by explaining what Docker is: / Its a framework to simplify creation of containers and its not a virtualization in the traditional way / We continued using Docker to get our Shopware instance up and running / Which lend us to employ good software engineering practice to separate the big container mess we created into smaller reusable containers / Eventually we took it one step further and also „Dockerized“ other tasks like deployment