AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
Super powered Drupal development with docker
1. Drupal and Docker
Super powered drupal development
MACIEJ.LUKIANSKI@DROPTICA.COM
How to use docker to make drupal development
easier, quicker and more productible
3. Problems of a dev team
● Multiple stacks
○ php 5.2 - 7.x
○ Many libraries & versions
○ Apache Solr 4.x to 6.x
○ Redis, Memcached
○ MongoDB, Nodejs, Elasticsearch
○ other
● How to:
○ Onboard developers quickly
○ Deploy and maintain integrity of environments:
■ dev,
■ test,
■ test_feature_7773
■ stage,
■ stage2,
■ ….
■ prod
○ Test the environments?
○ Propagate changes of environments between
team?
● Complex projects
○ Systems with APIs
○ Microservices
○ Legacy systems on outdated stacks
WWW.DROPTICA.COMDocker and Drupal
4. Possible solutions
● Use everyone’s local setups and hope it works
● Manually configure, upgrade, downgrade on each machine
● Virtualbox (with Puppet/Chef/Ansible)
● Vagrant
● Remote workspaces
WWW.DROPTICA.COMDocker and Drupal
● DOCKER - yay!
5. Our docker benefits
● Very few deployment surprises
○ No more “It worked on my machine”
WWW.DROPTICA.COMDocker and Drupal
● ~ 500 hours a year saved:
○ Setting up a project takes 10 minutes (3-5 commands)
○ Test/Stage environments in few minutes
○ No more differences between environments
○ Simplicity of services that took time to set up (solr, elasticsearch, mongo, node, postgres, other)
● We are looking beyond
○ cross functional expert teams
○ microservices
○ other technologies
● Stacks generally work (developers program rather than fight the architecture)
○ All config in code
6. How we do it?
WWW.DROPTICA.COMDocker and Drupal
● boilerplate images
● docker-console (custom script)
● docker-compose
7. Docker compose
● simple config file
● starting images often
enough
WWW.DROPTICA.COMDocker and Drupal
8. Once you get
the hang of it..
SSL for free with
jrcs/letsencrypt-nginx-proxy-companion
Separate images for crons
Backup as a service from a
separate image (create once,
use always)
Apache Solr quickly
available and configured
also locally
WWW.DROPTICA.COMDocker and Drupal
10. How do I develop?
Where is drush?
Where is mysqldump?
Where is a sass compiler?
And all other development tools?
Apache &
PHP
mysql
Apache
Solr
mailer backup
mongodb
WWW.DROPTICA.COMDocker and Drupal
docker-compose.yml
11. php-developer & docker-console
Apache &
PHP
mysql
php-developer
(developer container)
sample commands:
dcon drush uli
dcon drush cc all
dcon shell -s
Apache
Solr
mailer backup
other
1. drush
2. Sass (ruby gems etc)
3. npm, bower, fabric,
4. Other tools
gives you a server-like feeling
WWW.DROPTICA.COMDocker and Drupal
12. ● understands docker-compose.yml
● Multiple pre-built commands
● Building workflows like lego
● Custom commands (in python)
Docker console ~$ pip install docker-console
An additional application which helps to
automate workflow using the
php-developer image
WWW.DROPTICA.COMDocker and Drupal
14. Heavy equipment dealer website
WWW.DROPTICA.COMDocker and Drupal
● Drupal
● Redis for cache
● Search with solr
● Mongodb with some data from
other system
15. Demo dealer dev environment
Apache & PHP
(to serve drupal)
+ php libraries
for mongodb
mysql
Apache
Solr
mongodb
WWW.DROPTICA.COMDocker and Drupal
Admin panel
for mongo
(mogo-express)
redis
17. New developer comes along
WWW.DROPTICA.COMDocker and Drupal
1. git pull git@git-url-to-the-repository
2. cd repository
3. docker-console up
Apache & PHP
+ php libraries for
mongodb
mysql
Apache Solr
mongodb
Admin
panel for
mongo
and presto
Redis
To import db, composer install, run updates etc:
1. fab get-dbases
2. Docker-console build Project set up and working
18. But where is the demo ??
WWW.DROPTICA.COMDocker and Drupal
19. This is too simple..
WWW.DROPTICA.COMDocker and Drupal
Show me more complex
20. Nginx to serve
Drupal
cron daily
cron alerts
cron html
printouts
Mailer
XML generator
Rabbitmq
tests
PHP
cron search api
cron emails
daily
DRUPAL
codebase
blackfire
cron emails
weekly
Nginx to serve
xml extracts
WWW.DROPTICA.COMDocker and Drupal
....
14 cron
containers
…..
Mailcatcher
Files
Mysql
Redis
Solr
23. Additional Benefits
● Easy to see what environment consist of (all is in code)
● A move towards SOA (we do not care how solr or rabbitmq is set up)
● Great step towards microservices
WWW.DROPTICA.COMDocker and Drupal
● Upgrades of stack are a breeze (php5 -> php7 is a one line)
● Easier to explore technologies - “there is an image for that”
24. ● don’t hold data in containers (map volumes or use docker volumes)
● don’t hold multiple services in one container
● do use code for config (Dockerfile, docker-compose)
Dos and don’ts
WWW.DROPTICA.COMDocker and Drupal
25. ● github.com/droptica/docker-tutorial
How to start
WWW.DROPTICA.COMDocker and Drupal
● Use docker for services
solr:
image: solr.6
ports:
- 8983:8983
redis:
image: redis
● www.droptica.com/blog
26. Thank you
Imię i Nazwisko autora
Maciej Lukianski
maciej.lukianski@droptica.com
@MaciejLukianski
Contact details:
WWW.DROPTICA.COM