Docker, Drupal and Persistence

Slides:



Advertisements
Similar presentations
Shining A Light on Open Source Software: Going Beyond LAMPP Serving Web Content Using Open Source Software.
Advertisements

FIRST SESSION - XAMPP Jeongmin Lee.  Jeongmin Lee  CS  PHD  Machine Learning, AI  Web System Development.
AppManager 7: Deep Technical Dive Tim Sedlack & Michi Schniebel Sr. Product Managers.
27-Jun-15 Rails. What is Rails? Rails is a framework for building web applications This involves: Getting information from the user (client), using HTML.
Docker Martin Meyer Agenda What is Docker? –Docker vs. Virtual Machine –History, Status, Run Platforms –Hello World Images and Containers.
Docker Martin Meyer Agenda What is Docker? –Docker vs. Virtual Machine –History, Status, Run Platforms Hello World Terminology: Image and.
PHP Scripting Language. Introduction “PHP” is an acronym for “PHP: Hypertext Preprocessor.” It is an interpreted, server-side scripting language. Originally.
Amazon EC2 Quick Start adapted from EC2_GetStarted.html.
Securing LAMP: Linux, Apache, MySQL and PHP Track 2 Workshop PacNOG 7 July 1, 2010 Pago Pago, American Samoa.
SEEM4570: XAMPP, Eclipse, Summary of Html Kangfei Zhao Room 711,ERB
SYST Web Technologies SYST Web Technologies Installing a Web Server (XAMPP)
One to One instructions Installing and configuring samba on Ubuntu Linux to enable Linux to share files and documents with Windows XP.
Creating a Web Presence Introduction to WordPress Week 1.
Installing and Configuring Tomcat A quick guide to getting things set up on Windows.
DB2 (Express C Edition) Installation and Using a Database
WaveMaker Visual AJAX Studio 4.0 Training Installation.
Managing Drupal with Aegir Chris Burge Burge Consulting, LLC 30 June 2013 Dublin, Ireland Drupal Dev Days.
Composer packages Installing and Using Composer, Packagist, Packaging your code Mario Peshev Technical Trainer Software University
Drush: The Drupal Shell Utility Trevor Mckeown Founder & Owner Sublime Technologies
1 Session 1: Introduction to PHP & MySQL iNET Academy Open Source Web Development.
Apache, MySQL and PHP Installation and Configuration Chapter 2 MySQL Installation and Configuration.
CNIT 124: Advanced Ethical Hacking Docker (not in textbook) & Ch 8: Exploitation.
WAMP Server Installatin Shiyun Wen. WAMP Server Installation  WAMP Server is an integrated installation of Apache, MySQL, and PHP for Windows. Following.
WMarket For Adminstrators Install with Docker or the Automatic Script.
Hyperion Artifact Life Cycle Management Agenda  Overview  Demo  Tips & Tricks  Takeaways  Queries.
Introduction to Linux Server Setup Jonathan Hood CSE 4000 Practical Issues in Software Engineering.
Installing Koha Presented By Aaron R. Williams KOHA North American Users Group.
Alfresco deployment with Docker Andrea Agili Software Engineer – Dr Wolf srl Tommaso Visconti DevOps – Dr Wolf srl.
Installing and Configuring Moodle. Download Download latest Windows Install package from Moodle.orgMoodle.org.
WordPress and Etherpad with BlueMix and Docker. Our aim is to run on BlueMix containers (now in beta) these two famous services In the BlueMix dashboard,
L.A.M.P. İlker Korkmaz & Kaya Oğuz CS 350. Why cover a lecture on LAMP? ● Job Opportunities – There are many hosting companies offering LAMP as a web.
Getting Started as an EdgeX Developer
Web Application Development with Laravel and Bootstrap
Kickstart drupal development
Getting & Running EdgeX Docker Containers
Containers as a Service with Docker to Extend an Open Platform
Setup a PHP + MySQL Development Environment
WordPress Introduction
Docker and Azure Container Service
Chapter 5 Linux Services
Docker Birthday #3.
OFBiz Internals.
In-Depth Introduction to Docker
Docker – kontejnerizacija na serveru Vedran Vučetić, SPAN
Getting Started as an EdgeX Developer
Containers and Virtualisation
Andrew Pruski SQL Server & Containers
Lab 1 introduction, debrief
Drupal VM and Docker4Drupal For Drupal Development Platform
Node.js Packages Header Mastering Node.js, Part 4 Eric W. Greene
Drupal VM and Docker4Drupal as Consistent Drupal Development Platform
Coding in the Cloud This slide deck includes recorded video demonstrations of content from the live presentation. Joon-Yee.
Azhagappan Arunachalam
Introduction to Docker
INSTALLING AND SETTING UP APACHE2 IN A LINUX ENVIRONMENT
Oracle DB and Docker Get Your Dockerized Oracle Sandbox Running in the Cloud or On- Premises Martin Knazovicky Dbvisit Software.
Advisor: Dr.vahidipour Zahra salimian Dec 2017
Intro to Docker Containers and Orchestration in the Cloud
Dovetail & CVP Tutorial/Demo
Pantheon Terminus Bill Juda.
Configuration Of A Pull Network.
Step by step installation of a Domino server on Docker
Hyperledger Fabric and Composer Install
Docker Some slides from Martin Meyer Vagrant Box:
CloudOpting - Hackathon
Introduction to Docker
Container technology, Microservices, and DevOps
Iterating Faster with Docker + Cascade
Azure Container Service
Container technology, Microservices, and DevOps
Presentation transcript:

Docker, Drupal and Persistence Bill Juda

Who am I? Bill Juda (wfj24@cornell.edu) Drupal Developer for CIT Custom Development. Started working with Drupal in 2013.

Agenda Disclaimer What is Drupal? What is docker? What is docker-compose? My setup - let's look at code! Demo - how does it work? Documentation links. Questions?

Disclaimer Local development environments setup are usually based on personal preferences and knowledge. I am not saying that this is the right setup for you. This is just another option for you to look at.

What is Drupal? You know what is it… Or if you don’t it is a Content Management System. Basically a sweet platform that makes sure developers don’t have to enter content!!

What is Docker? Docker is a containerization system What is a Container? A Docker container image is a lightweight, standalone, executable package of software that includes everything needed to run an application: code, runtime, system tools, system libraries and settings. - Docker Docker website for more information: https://www.docker.com/ For me it is a portable development environment that can be setup on Linux, Mac, or Windows with its configuration is stored entirely in code.

What is Docker continued.

Getting Docker Get docker: https://www.docker.com/ Register for an account Download and install docker

docker-compose “Compose is a tool for defining and running multi-container Docker applications” - Docker Docs For me it allows me to manage our local environment setup in code. Documentation: https://docs.docker.com/compose/ docker-compose comes with your download of docker!

My setup Custom docker image for a Ubuntu PHP/Apache2 web server. Seperate project folder for each website I support. Each project folder contains A git repository to store the Drupal codebase. Mysql directory to store the database files for persistence. Restore directory to put back files in to restore environment. Config directory to store some mysql specific config and apache config. docker-compose.yaml

My custom Docker web server image. The base image I build from is ubuntu:latest. I install PHP, Apache2, mysql-client, and lots of supporting items. This setup is based on my experience hosting various Drupal 7 and Drupal 8 instances. Let's take a look...

My Dockerfile for building my Docker image FROM ubuntu:latest RUN apt update --fix-missing # FIX TIMEZONE ISSUE RUN apt install tzdata -y # UTILS THAT ARE NEEDED RUN apt install vim git zip wget curl -y # STYLE TOOLS LESS AND COMPASS RUN apt install npm -y && npm install -g less RUN apt install ruby-compass -y && gem install sass-globbing # APACHE2 NEEDED RUN apt-get install apache2 -y && a2enmod rewrite ssl # MYSQL CLIENT TO CONNECT BACK TO NETWORKED MYSQL CONTAINER RUN apt-get install mysql-client -y

Dockerfile continued # GET ALTERNATIVE PHP VERSIONS IF YOU DON'T WANT STANDARD # RUN apt-get install -y software-properties-common apt-utils language-pack-en-base # RUN LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php # RUN apt-get update -y # PHP NEEDED - DEFAULT UBUNTU IS PHP7.2 RUN apt-get install -y php RUN apt-get install -y php-common php-curl php-gd php-xml php-mysql php-mbstring php-zip php-ldap php-imagick # PHP 5.6 # RUN apt-get install -y php5.6 # RUN apt-get install -y php5.6-common php5.6-curl php5.6-gd php5.6-xml php5.6-mysql php5.6-mbstring php5.6-zip php5.6-ldap php5.6-imagick # PHP 7.1 # RUN apt-get install -y php7.1 # RUN apt-get install -y php7.1-common php7.1-curl php7.1-gd php7.1-xml php7.1-mysql php7.1-mbstring php7.1-zip php7.1-ldap php7.1-imagick

Dockerfile continued # PHP APACHE2 HOOKUP STUFF # SELECT CORRECT VERSION BASED ON PHP VERSION RUN apt-get install -y libapache2-mod-php # RUN apt-get install -y libapache2-mod-php5.6 # RUN apt-get install -y libapache2-mod-php7.1 # IF USING ALTERNATIVE PHP VERSION UPDATE BUT ALSO RESTART APACHE2 RUN service apache2 restart # RUN update-alternatives --set php /usr/bin/php5.6 && service apache2 restart # RUN update-alternatives --set php /usr/bin/php7.1 && service apache2 restart

Dockerfile continued # COMPOSER INSTALL RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && php composer-setup.php && mv composer.phar /usr/local/bin/composer && php -r "unlink('composer-setup.php');" # DRUPAL CONSOLE INSTALL RUN curl https://drupalconsole.com/installer -L -o drupal.phar && chmod +x drupal.phar && mv drupal.phar /usr/local/bin/drupal # DRUSH INSTALL RUN composer global require drush/drush:8.x-dev --prefer-source && ln -s /root/.composer/vendor/drush/drush/drush /usr/local/bin # RUN composer global require drush/drush:9.x-dev --prefer-source && ln -s /root/.composer/vendor/drush/drush/drush /usr/local/bin # UPDATE AND CLEANUP # RUN apt-get dist-upgrade -y && apt-get autoremove -y CMD ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]

My docker-compose.yaml This contains: The configuration of my mysql database container and my webserver container. The mapping of directories based on my program folder to allow for persistence of my Drupal environments. The networking of these two containers. Let’s take a look...

Code - docker-compose.yaml version: '3.5' services: db: container_name: db image: mysql:5 ports: - "3307:3306" environment: MYSQL_ROOT_PASSWORD: DRUPALCAMP MYSQL_DATABASE: drupal volumes: - ./mysql:/var/lib/mysql - ./conf/my-custom.cnf:/etc/mysql/conf.d/my-custom.cnf tty: true restart: always networks: - overlay

Continued - docker-compose.yaml web: container_name: webserver image: web_web:latest volumes: - ./app:/var/www - ./conf/apache-drupal.conf:/etc/apache2/sites-enabled/000-default.conf - ./restore:/restore - ./conf/my-custom.cnf:/etc/mysql/conf.d/my-custom.cnf ports: - 80:80 - 443:443 tty: true depends_on: - db restart: always networks: - overlay overlay: name: network

Common docker-compose and docker command docker-compose build Build a docker image from a docker compose file. docker-compose up -d Create a docker env from docker files and detach so you are not stuck in your terminal. docker ps -a Show me all docker containers. docker exec -it [container_name or container_id] bash Get into a docker container in a bash prompt docker stop $(docker ps -qa) Stop all docker container docker rm $(docker ps -qa) Delete all docker container

DEMO!!!

Helpful Links Docker: https://www.docker.com/ Docker Docs: https://docs.docker.com/ Docker Compose: https://docs.docker.com/compose/ My setup for you: https://github.com/judaw/docker-stuff

Questions? wfj24@cornell.edu