Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Docker For PHP Dev Environments

Docker For PHP Dev Environments

A blueprint for how to set up fast, representative, no-fuss PHP dev environments using Docker.

Presented at @phpminds in Nottingham on 12th October 2017.

Stuart Herbert

October 12, 2017
Tweet

More Decks by Stuart Herbert

Other Decks in Programming

Transcript

  1. @GanbaroDigital 1999/2000 2008 2010 2012 2015 VMWare Workstation VMWare ESX

    Linux KVM VirtualBox & Vagrant Docker Containers
  2. @GanbaroDigital After two years of doing all my dev work

    in containers … … I’m never going back to developing in VMs.
  3. @GanbaroDigital Docker Compose (has no logo - sorry) (ships with

    Docker for Mac) (separate download on Linux)
  4. @GanbaroDigital Steps 1. Create a network for our dev env

    2. Define our dev env 3. Get DNS working for our dev env 4. Add a database server 5. Add our app
  5. @GanbaroDigital Steps 1. Create a network for our dev env

    2. Define our dev env 3. Get DNS working for our dev env 4. Add a database server 5. Add our app
  6. @GanbaroDigital Steps 1. Create a network for our dev env

    2. Define our dev env 3. Get DNS working for our dev env 4. Add a database server 5. Add our app
  7. @GanbaroDigital Steps 1. Create a network for our dev env

    2. Define our dev env 3. Get DNS working for our dev env 4. Add a database server 5. Add our app
  8. @GanbaroDigital Multi-Resolver O/S Support 1. Ubuntu 16.04 - supported by

    default 2. Ubuntu 17.04 - install & config required 3. MacOS - supported by default
  9. @GanbaroDigital Out of the box, Docker for Mac needs an

    extra step. I’ll cover that separately at the end.
  10. @GanbaroDigital Steps 1. Create a network for our dev env

    2. Define our dev env 3. Get DNS working for our dev env 4. Add a database server 5. Add our app
  11. @GanbaroDigital You can use MySQL Workbench from the host OS

    too. Or any other tools. It’s just MySQL after all.
  12. @GanbaroDigital Steps 1. Create a network for our dev env

    2. Define our dev env 3. Get DNS working for our dev env 4. Add a database server 5. Add our app
  13. @GanbaroDigital I switched to Linux for all my dev work.

    Because that’s where the best Docker experience is.
  14. @GanbaroDigital Image Credits 1. Docker Logo:
 https://www.docker.com/brand-guidelines 2. Brigadier Mk3:

    https://flic.kr/p/jB4t16 3. Container Wall: https://flic.kr/p/fMsCgA 4. Container Ship: https://flic.kr/p/SGHmdX
  15. @GanbaroDigital Image Credits 1. Brick Wall: https://flic.kr/p/wCRJZ4 2. Single Tortoise:

    https://flic.kr/p/wBEFaf 3. Multiple Tortoises: https://flic.kr/p/RxXZag 4. Isolation: https://flic.kr/p/pQnn9e