Docker Compose
Drupal Development Environments with Docker Compose
Me
- mccrodp on d.org
- Work for X-Team
- Pantheon.io; Website Management Tools
- Programs: Unleash; Dojo, etc.
- Want a job? - msg me
What is this talk about?
- How? complex dev environments...
- What? Vagrant; Puppet, Chef, Ansible...etc.
- Confused! I’m not an admin...
- Boring! Waste of time.
- Enter Docker :)
What is Docker?
An open platform for distributed applications for developers and sysadmins
- Agility
- Control
- Portability
Containers v.s. VMs
Benefits of Docker!
Dev
- Accelerate
- Eliminate
- Collaborate
Deploy
- Ship Frequently
- Scale easily
Docker in the Cloud
Getting started
- Mac / Win users: install Docker Toolbox ;
- boot2docker
- CLI client & Docker Machine
- Docker Compose:
docker-compose
- Kitematic (GUI) & Docker QuickStart shell
- DockerHub
- Demo!
But... my DB server?
Options
- Use mySQLite?
- or a linked container?
Is this good enough?
- Extra management
- More commands
Solution: Docker Compose
“a tool for defining and running multi-container Docker applications”
Compose file docker-compose.yml
Wrapper CLI docker-compose
Docker Compose file
A docker-compose.yml looks like this:
version: '2'
services:
web:
build: .
ports:
- "5000:5000"
volumes:
- .:/code
- logvolume01:/var/log
links:
- redis
redis:
image: redis
volumes:
logvolume01: {}
Using Docker Compose
- Configure yml file
- Up containers!
docker-compose up -d
- Run
docker-compose exec container_name drush status
- Stop
docker-compose stop
- Destroy
docker-compose destroy
Demo
Conclusion
- Docker is great
- Try it out
- Open any issues on the GitHub repo