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

Unbox Development in Production

Hamzeen. H.
November 20, 2015

Unbox Development in Production

My talk for JSConf Asia 2015, building a PHP Dev Box with Vagrant. It uses puppet for provisioning & VirtualBox as the provider. Metadata, guest:ubuntu/trusty64 | host:OSX/Yosemite | port:1234

Hamzeen. H.

November 20, 2015
Tweet

Other Decks in Programming

Transcript

  1. A new developer joins your team… Then you spend your

    next couple of days setting up their tools, development environment, configurations & etc.
  2. Another developer from your team finds a tricky bug.. But

    you couldn’t reproduce it on your machine.
  3. open source platform for software containerization, designed for fast delivery

    of applications. It allows to create lightweight, portable & self-contained apps.
  4. Create & configure lightweight, reproducible & portable development environments. It

    wraps around virtualization software apart from its support for configuration management.
  5. # download a simple VM $ vagrant box add base

    http://files.vagrantup.com/ precise64.box # initialise $ vagrant init # boot the VM with above configurations $ vagrant up
  6. • A command-line VM management tool for developers • Enables

    Portable Development Environments • Invented by Mitchell Hashimoto (Jan 2010) • Open Source http://github.com/mitchellh/vagrant • Providers VMware, VirtualBox, AWS • Provisioners Puppet, Ansible, Chef, Salt
  7. • Before we start, install these: VirtualBox, Vagrant • Provisioning:

    Puppet • Vagrant Provider: VirtualBox • The Vagrantfile internally refers a Shell Script for software setup • The Shell Script sets up the MAMP stack (installs Apache, PHP, MySQL & PHPMyAdmin with default configurations)
  8. $ git clone https://github.com/hamzeen/vagrant-php-box.git $ cd vagrant-php-box $ sudo vagrant

    up visit here (once) to create the database and tables http localhost:1234/firstrun // clone the git repo // setup, build & deploy the vagrant project
  9. We are done here! The app is ready to serve

    you at: http: localhost:1234 </> Want to start your own vagrant project & spin up a VM of your choice? $ vagrant init debian/wheezy64 $ vagrant up </> Changed Vagrantfile? $ vagrant reload $ vagrant up
  10. • Both allows to configure portable Dev Envs & employ

    LxC (Linux Containers) Vagrant • Focus: Portable Dev Envs • Virtualization: Interfaces with VM Managers • Since Jan 2010 Docker • Focus: Production & Deployment • Containers not Virtual Machines • Fast • Since Mar 2013