SlideShare a Scribd company logo
1 of 34
Download to read offline
ContentBox + Docker
Gavin Pickin
●
About Me?
Docker Images
● Ortus Solutions has built and supports a few docker images, the most
common and popular
○ ortussolutions/commandbox
https://hub.docker.com/r/ortussolutions/commandbox/
● Ortus Solutions has built one especially for ContentBox
○ Adds several bells and whistles to help get your ContentBox app ready to deploy to docker
○ ContentBox Image updated for Version 4.0 release.
CommandBox Docker Image
https://hub.docker.com/r/ortussolutions/commandbox/
● Gives you commandbox, ready to go.
● Run any CF Engine or WAR file
● Use CFConfig to configure your cfml engine
● Use environment values for overrides
● Put your files in the /app directory and start the server of your choice
Your app is yours, and how you set it up, config it, is all up to you.
ContentBox Docker Image
https://hub.docker.com/r/ortussolutions/contentbox/
ContentBox’s image is built upon CommandBox, so it’s everything plus:
● Datasource config
● Distributed caching for content, rss etc
● Environment Overrides for ContentBox settings
● Embedded H2 DB support
● And more
Use PORTAINER
https://portainer.io/
Awesome, Free Opensource
Kiwi Powered :)
Portainer
ContentBox Image - Express version
● The express version uses an in memory H2 database.
● Perfect for setting up for testing.
● If you start with the express=true and install=true you can install a fresh
contentbox site into the H2 database
docker run -p 8080:8080 
-e express=true 
-e install=true 
ortussolutions/contentbox
ContentBox Image - Persisting Data
Docker doesn’t care about your data / files.
If you want to keep it, persist it.
Here we mount 2 volumes into the H2 data folder and the media folder
docker run -p 8080:8080 
-e express=true 
-e install=true 
-v `pwd`/contentbox-db:/data/contentbox/db 
-v `pwd`/contentbox-media:/app/includes/shared/media 
ortussolutions/contentbox
ContentBox Image - Environment Variables
This image allows you to pass in a series of environment variables to default your
values when installing ContentBox
● Express
● Install
● FWREINIT_PW
● SESSION_STORAGE
● DISTRIBUTED_CACHE
● H2_DIR
● contentbox_default_*
● ORM_SECONDARY_CACHE
● ORM_DIALECT
ContentBox Image - Database Connections
● To programmatically configure the database on container start, environment
variables which represent your datasource configuration should be provided.
There are two patterns supported:
○ DB_DRIVER configuration - which may be used for Adobe Coldfusion servers
○ DB_CLASS configuration - which configures a datasource by JDBC driver and
connection string.
ContentBox Image - Database Connections
MYSQL Setup
docker run -p 8080:8080 
-e 'express=true' 
-e 'installer=true' 
-e 'cfconfig_adminPassword=myS3cur3P455' 
-e
"DB_CONNECTION_STRING=jdbc:mysql://mysqlhost:3306/contentbox_docker?useUnicode=true&characterEncoding=UT
F-8&useLegacyDatetimeCode=true" 
-e 'DB_CLASS=org.gjt.mm.mysql.Driver' 
-e 'DB_USER=contentbox_user' 
-e 'DB_PASSWORD=myS3cur3P455' 
-v `pwd`/contentbox-media:/app/includes/shared/media 
ortussolutions/contentbox
ContentBox Image - Database Connections
MSSQL Setup on Adobe
docker run -p 8080:8080 
-e 'CFENGINE=adobe@11' 
-e 'installer=true' 
-e 'cfconfig_adminPassword=myS3cur3P455' 
-e 'DB_DRIVER=MSSQLServer' 
-e 'DB_HOST=sqlserver_host' 
-e 'DB_PORT=1433' 
-e 'DB_NAME=contentbox_docker' 
-e 'DB_USER=sa' 
-e 'DB_PASSWORD=myS3cur3P455' 
-v `pwd`/contentbox-media:/app/includes/shared/media 
ortussolutions/contentbox
ContentBox Image - Distributed Cache
● By default, this image is configured to use the connected database as a caching
storage as well. This will allow you to distribute your stack with pseudo-caching
enabled.
● However, if you would like to have a real distributed cache like Redis or Couchbase
connected to your images, you will need to use the appropriate CacheBox providers
and your own custom CacheBox.cfc configuration file. For an example of using Redis,
check out our compose repository:
https://github.com/Ortus-Solutions/docker-contentbox-distributed
What if I have a ContentBox site already?
Two Options
● Extract your changes from your old site and mount/copy them into
ContentBox’s Docker Image - let’s look at that first
● Update your existing site to use some ContentBox Docker Image magic - we’ll
look at this in a little while
Let’s startup a site with ContentBox image
● docker run -p 8080:8080
-e 'cfconfig_adminPassword=password'
-e "DB_CLASS=org.gjt.mm.mysql.Driver"
-e "DB_CONNECTION_STRING=jdbc:mysql://172.17.0.4:3306/golfgk?useUnicode=
true&characterEncoding=UTF-8&useLegacyDatetimeCode=true"
-e "DB_USER=root"
-e "DB_PASSWORD=secretpassword"
ortussolutions/contentbox
http://127.0.0.1:8080/
Folder Structure - Where are my Files?
Working with Docker where everything is in the image already is a little weird to
say the least.
You only need what is different in your local files
● Mount the persistent files as a volume
● Mount / Copy the Changes
Let’s add our Media into the Image
docker run -p 8080:8080 -e 'cfconfig_adminPassword=password' -e
"DB_CLASS=org.gjt.mm.mysql.Driver" -e
"DB_CONNECTION_STRING=jdbc:mysql://172.17.0.4:3306/golfgk?useUnicode=true&characterE
ncoding=UTF-8&useLegacyDatetimeCode=true" -e "DB_USER=root" -e
"DB_PASSWORD=r3@lc@m@"
-v c:/www/__docker_contentbox/contentbox-media:/app/includes/shared/media
ortussolutions/contentbox
http://127.0.0.1:8080/
Let’s add our Theme into the Image
docker run -p 8080:8080 -e 'cfconfig_adminPassword=password' -e
"DB_CLASS=org.gjt.mm.mysql.Driver" -e
"DB_CONNECTION_STRING=jdbc:mysql://172.17.0.4:3306/golfgk?useUnicode=true&characterE
ncoding=UTF-8&useLegacyDatetimeCode=true" -e "DB_USER=root" -e
"DB_PASSWORD=r3@lc@m@"
-v c:/www/__docker_contentbox/contentbox-media:/app/includes/shared/media
-v c:/www/__docker_contentbox/themes/golfnk:/app/modules_app/contentbox-custom/_themes/golfnk
ortussolutions/contentbox
http://127.0.0.1:8080/
Add Magic into Existing Site
How does ContentBox’s Docker Image do all of this?
● Secret - Some of this is already in ContentBox 3.7.x & more in 4.x
● You need some functions added to your Application.cfc
● You need some config added to your config/Coldbox.cfc
● You need some config added to your config/CacheBox.cfc
Let’s get into it.
ContentBox’s ModuleConfig.cfc
New functions in the ModuleConfig.cfc
https://github.com/Ortus-Solutions/ContentBox/blob/development/modules/contentbox/Modul
eConfig.cfc#L118
ContentBox’s Application.cfc
New in Docker Image
https://github.com/Ortus-Solutions/docker-contentbox/blob/development/resources
/app/Application.cfc
Get Environment Variables from Java
https://github.com/Ortus-Solutions/docker-contentbox/blob/development/resources
/app/Application.cfc#L20
ContentBox’s Application.cfc ( 2 )
SessionStorage from Env Variable
https://github.com/Ortus-Solutions/docker-contentbox/blob/development/resources
/app/Application.cfc#L20
Include Datasource Mixin
https://github.com/Ortus-Solutions/docker-contentbox/blob/development/resources
/app/Application.cfc#L56
ContentBox’s Application.cfc ( 3 )
Secondary ORM Cache
https://github.com/Ortus-Solutions/docker-contentbox/blob/development/resources
/app/Application.cfc#L70
ContentBox’s Coldbox.cfc
New in Docker Image
https://github.com/Ortus-Solutions/docker-contentbox/blob/development/resources
/app/config/Coldbox.cfc
Load Java Env Variables
https://github.com/Ortus-Solutions/docker-contentbox/blob/development/resources
/app/config/Coldbox.cfc#L14
ContentBox’s Coldbox.cfc ( 2 )
FW Reinit Password
https://github.com/Ortus-Solutions/docker-contentbox/blob/development/resources
/app/config/Coldbox.cfc#L22
Distributed Cache Setting
https://github.com/Ortus-Solutions/docker-contentbox/blob/development/resources
/app/config/Coldbox.cfc#L98
ContentBox’s Coldbox.cfc ( 3 )
Distributed Sessions
https://github.com/Ortus-Solutions/docker-contentbox/blob/development/resources
/app/config/Coldbox.cfc#L117
ContentBox Runtime Overrides
https://github.com/Ortus-Solutions/docker-contentbox/blob/development/resources
/app/config/Coldbox.cfc#L126
ContentBox’s CacheBox.cfc
Normal ContentBox Cachebox.cfc
https://github.com/Ortus-Solutions/ContentBox/blob/development/config/CacheBo
x.cfc
New in Docker Image
https://github.com/Ortus-Solutions/docker-contentbox/blob/development/resources
/app/config/CacheBox.cfc
ContentBox’s CacheBox.cfc ( 2 )
Session Cache set to the DB
https://github.com/Ortus-Solutions/docker-contentbox/blob/development/resources
/app/config/CacheBox.cfc#L55
New JDBC Cache setup for distributed Cache
https://github.com/Ortus-Solutions/docker-contentbox/blob/development/resources
/app/config/CacheBox.cfc#L71
Live coding moment of truth
Deploy to the Cloud!!!!
docker run -d -p 8080:8080 -e 'cfconfig_adminPassword=password' -e
"DB_CLASS=org.gjt.mm.mysql.Driver" -e
"DB_CONNECTION_STRING=jdbc:mysql://204.48.54.78:3306/golfnk?useUnicode=true&characterEncod
ing=UTF-8&useLegacyDatetimeCode=true" -e "DB_USER=secret" -e "DB_PASSWORD=topsecret" -v
/mnt/volume-sfo2-01/contentbox-media:/app/includes/shared/media -v
/mnt/volume-sfo2-01/themes/golfnk:/app/modules/contentbox/themes/golfnk gpickin/cb
Live coding moment of truth
Instance 2
docker run -d -p 8081:8080 -e 'cfconfig_adminPassword=password' -e
"DB_CLASS=org.gjt.mm.mysql.Driver" -e
"DB_CONNECTION_STRING=jdbc:mysql://204.48.54.78:3306/golfnk?useUnicode=true&characterEncod
ing=UTF-8&useLegacyDatetimeCode=true" -e "DB_USER=secret" -e "DB_PASSWORD=topsecret" -v
/mnt/volume-sfo2-01/contentbox-media:/app/includes/shared/media -v
/mnt/volume-sfo2-01/themes/golfnk:/app/modules/contentbox/themes/golfnk gpickin/cb
Questions
Want More?
Docker Mastery Course - https://www.udemy.com/docker-mastery/
Ortus Solutions Website - https://www.ortussolutions.com/events
Slack Channel - http://boxteam.herokuapp.com/
Twitter - https://twitter.com/ortussolutions/
CF Summit 2018 ( Las Vegas ) - Talk to us about a Training after the conference
Thanks
Thanks everyone
There are a few more great sessions left, don’t miss out.
Hope to see you all next year at Into the Box
And CF Summit later in the year
Travel Safe

More Related Content

What's hot

Kubernetes Story - Day 3: Deploying and Scaling Applications on OpenShift
Kubernetes Story - Day 3: Deploying and Scaling Applications on OpenShiftKubernetes Story - Day 3: Deploying and Scaling Applications on OpenShift
Kubernetes Story - Day 3: Deploying and Scaling Applications on OpenShift
Mihai Criveti
 
Developing and Deploying PHP with Docker
Developing and Deploying PHP with DockerDeveloping and Deploying PHP with Docker
Developing and Deploying PHP with Docker
Patrick Mizer
 
Binary Packaging for HPC with Spack
Binary Packaging for HPC with SpackBinary Packaging for HPC with Spack
Binary Packaging for HPC with Spack
inside-BigData.com
 

What's hot (20)

How Helm, The Package Manager For Kubernetes, Works
How Helm, The Package Manager For Kubernetes, WorksHow Helm, The Package Manager For Kubernetes, Works
How Helm, The Package Manager For Kubernetes, Works
 
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHPHands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
 
Kubernetes Story - Day 1: Build and Manage Containers with Podman
Kubernetes Story - Day 1: Build and Manage Containers with PodmanKubernetes Story - Day 1: Build and Manage Containers with Podman
Kubernetes Story - Day 1: Build and Manage Containers with Podman
 
Native Hadoop with prebuilt spark
Native Hadoop with prebuilt sparkNative Hadoop with prebuilt spark
Native Hadoop with prebuilt spark
 
Ansible Workshop for Pythonistas
Ansible Workshop for PythonistasAnsible Workshop for Pythonistas
Ansible Workshop for Pythonistas
 
Docker for PHP Developers - Madison PHP 2017
Docker for PHP Developers - Madison PHP 2017Docker for PHP Developers - Madison PHP 2017
Docker for PHP Developers - Madison PHP 2017
 
Docker @ FOSS4G 2016, Bonn
Docker @ FOSS4G 2016, BonnDocker @ FOSS4G 2016, Bonn
Docker @ FOSS4G 2016, Bonn
 
Drupal in Libraries
Drupal in LibrariesDrupal in Libraries
Drupal in Libraries
 
Kubernetes Story - Day 3: Deploying and Scaling Applications on OpenShift
Kubernetes Story - Day 3: Deploying and Scaling Applications on OpenShiftKubernetes Story - Day 3: Deploying and Scaling Applications on OpenShift
Kubernetes Story - Day 3: Deploying and Scaling Applications on OpenShift
 
B14870 solution final
B14870 solution finalB14870 solution final
B14870 solution final
 
開放運算&GPU技術研究班
開放運算&GPU技術研究班開放運算&GPU技術研究班
開放運算&GPU技術研究班
 
CiklumCPPSat: Alexey Podoba "Automatic assembly. Cmake"
CiklumCPPSat: Alexey Podoba "Automatic assembly. Cmake"CiklumCPPSat: Alexey Podoba "Automatic assembly. Cmake"
CiklumCPPSat: Alexey Podoba "Automatic assembly. Cmake"
 
JDD2014: Docker.io - versioned linux containers for JVM devops - Dominik Dorn
JDD2014: Docker.io - versioned linux containers for JVM devops - Dominik DornJDD2014: Docker.io - versioned linux containers for JVM devops - Dominik Dorn
JDD2014: Docker.io - versioned linux containers for JVM devops - Dominik Dorn
 
Docker for PHP Developers - php[world] 2017
Docker for PHP Developers - php[world] 2017Docker for PHP Developers - php[world] 2017
Docker for PHP Developers - php[world] 2017
 
Oracle Database on Docker
Oracle Database on DockerOracle Database on Docker
Oracle Database on Docker
 
Ece2013 Java Advanced Memorymanagement
Ece2013 Java Advanced MemorymanagementEce2013 Java Advanced Memorymanagement
Ece2013 Java Advanced Memorymanagement
 
Developing and Deploying PHP with Docker
Developing and Deploying PHP with DockerDeveloping and Deploying PHP with Docker
Developing and Deploying PHP with Docker
 
Docker for PHP Developers - ZendCon 2016
Docker for PHP Developers - ZendCon 2016Docker for PHP Developers - ZendCon 2016
Docker for PHP Developers - ZendCon 2016
 
Hands on Docker - Launch your own LEMP or LAMP stack
Hands on Docker -  Launch your own LEMP or LAMP stackHands on Docker -  Launch your own LEMP or LAMP stack
Hands on Docker - Launch your own LEMP or LAMP stack
 
Binary Packaging for HPC with Spack
Binary Packaging for HPC with SpackBinary Packaging for HPC with Spack
Binary Packaging for HPC with Spack
 

Similar to Into The Box 2018 | Content box + docker

Similar to Into The Box 2018 | Content box + docker (20)

Containerizing ContentBox CMS
Containerizing ContentBox CMSContainerizing ContentBox CMS
Containerizing ContentBox CMS
 
Magento Docker Setup.pdf
Magento Docker Setup.pdfMagento Docker Setup.pdf
Magento Docker Setup.pdf
 
Docker for Developers
Docker for DevelopersDocker for Developers
Docker for Developers
 
Introduction to Docker and Monitoring with InfluxData
Introduction to Docker and Monitoring with InfluxDataIntroduction to Docker and Monitoring with InfluxData
Introduction to Docker and Monitoring with InfluxData
 
CD in kubernetes using helm and ksonnet. Stas Kolenkin
CD in kubernetes using helm and ksonnet. Stas KolenkinCD in kubernetes using helm and ksonnet. Stas Kolenkin
CD in kubernetes using helm and ksonnet. Stas Kolenkin
 
Introduction to Docker storage, volume and image
Introduction to Docker storage, volume and imageIntroduction to Docker storage, volume and image
Introduction to Docker storage, volume and image
 
Docker primer and tips
Docker primer and tipsDocker primer and tips
Docker primer and tips
 
MySQL docker with demo by Ramana Yeruva
MySQL docker with demo by Ramana YeruvaMySQL docker with demo by Ramana Yeruva
MySQL docker with demo by Ramana Yeruva
 
Academy PRO: Docker. Part 2
Academy PRO: Docker. Part 2Academy PRO: Docker. Part 2
Academy PRO: Docker. Part 2
 
Cicd.pdf
Cicd.pdfCicd.pdf
Cicd.pdf
 
Lean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and DrushLean Drupal Repositories with Composer and Drush
Lean Drupal Repositories with Composer and Drush
 
Develop with docker 2014 aug
Develop with docker 2014 augDevelop with docker 2014 aug
Develop with docker 2014 aug
 
[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101
 
Improving build solutions dependency management with webpack
Improving build solutions  dependency management with webpackImproving build solutions  dependency management with webpack
Improving build solutions dependency management with webpack
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Getting Started with Docker
Getting Started with DockerGetting Started with Docker
Getting Started with Docker
 
ABCs of docker
ABCs of dockerABCs of docker
ABCs of docker
 
Learning Docker with Thomas
Learning Docker with ThomasLearning Docker with Thomas
Learning Docker with Thomas
 
How to Dockerize Web Application using Docker Compose
How to Dockerize Web Application using Docker ComposeHow to Dockerize Web Application using Docker Compose
How to Dockerize Web Application using Docker Compose
 
ContainerDayVietnam2016: Dockerize a small business
ContainerDayVietnam2016: Dockerize a small businessContainerDayVietnam2016: Dockerize a small business
ContainerDayVietnam2016: Dockerize a small business
 

More from Ortus Solutions, Corp

More from Ortus Solutions, Corp (20)

BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Ortus Government.pdf
Ortus Government.pdfOrtus Government.pdf
Ortus Government.pdf
 
Luis Majano The Battlefield ORM
Luis Majano The Battlefield ORMLuis Majano The Battlefield ORM
Luis Majano The Battlefield ORM
 
Brad Wood - CommandBox CLI
Brad Wood - CommandBox CLI Brad Wood - CommandBox CLI
Brad Wood - CommandBox CLI
 
Secure your Secrets and Settings in ColdFusion
Secure your Secrets and Settings in ColdFusionSecure your Secrets and Settings in ColdFusion
Secure your Secrets and Settings in ColdFusion
 
Daniel Garcia ContentBox: CFSummit 2023
Daniel Garcia ContentBox: CFSummit 2023Daniel Garcia ContentBox: CFSummit 2023
Daniel Garcia ContentBox: CFSummit 2023
 
ITB_2023_Human-Friendly_Scheduled_Tasks_Giancarlo_Gomez.pdf
ITB_2023_Human-Friendly_Scheduled_Tasks_Giancarlo_Gomez.pdfITB_2023_Human-Friendly_Scheduled_Tasks_Giancarlo_Gomez.pdf
ITB_2023_Human-Friendly_Scheduled_Tasks_Giancarlo_Gomez.pdf
 
ITB_2023_CommandBox_Multi-Server_-_Brad_Wood.pdf
ITB_2023_CommandBox_Multi-Server_-_Brad_Wood.pdfITB_2023_CommandBox_Multi-Server_-_Brad_Wood.pdf
ITB_2023_CommandBox_Multi-Server_-_Brad_Wood.pdf
 
ITB_2023_The_Many_Layers_of_OAuth_Keith_Casey_.pdf
ITB_2023_The_Many_Layers_of_OAuth_Keith_Casey_.pdfITB_2023_The_Many_Layers_of_OAuth_Keith_Casey_.pdf
ITB_2023_The_Many_Layers_of_OAuth_Keith_Casey_.pdf
 
ITB_2023_Relationships_are_Hard_Data_modeling_with_NoSQL_Curt_Gratz.pdf
ITB_2023_Relationships_are_Hard_Data_modeling_with_NoSQL_Curt_Gratz.pdfITB_2023_Relationships_are_Hard_Data_modeling_with_NoSQL_Curt_Gratz.pdf
ITB_2023_Relationships_are_Hard_Data_modeling_with_NoSQL_Curt_Gratz.pdf
 
ITB_2023_Extend_your_contentbox_apps_with_custom_modules_Javier_Quintero.pdf
ITB_2023_Extend_your_contentbox_apps_with_custom_modules_Javier_Quintero.pdfITB_2023_Extend_your_contentbox_apps_with_custom_modules_Javier_Quintero.pdf
ITB_2023_Extend_your_contentbox_apps_with_custom_modules_Javier_Quintero.pdf
 
ITB_2023_25_Most_Dangerous_Software_Weaknesses_Pete_Freitag.pdf
ITB_2023_25_Most_Dangerous_Software_Weaknesses_Pete_Freitag.pdfITB_2023_25_Most_Dangerous_Software_Weaknesses_Pete_Freitag.pdf
ITB_2023_25_Most_Dangerous_Software_Weaknesses_Pete_Freitag.pdf
 
ITB_2023_CBWire_v3_Grant_Copley.pdf
ITB_2023_CBWire_v3_Grant_Copley.pdfITB_2023_CBWire_v3_Grant_Copley.pdf
ITB_2023_CBWire_v3_Grant_Copley.pdf
 
ITB_2023_Practical_AI_with_OpenAI_-_Grant_Copley_.pdf
ITB_2023_Practical_AI_with_OpenAI_-_Grant_Copley_.pdfITB_2023_Practical_AI_with_OpenAI_-_Grant_Copley_.pdf
ITB_2023_Practical_AI_with_OpenAI_-_Grant_Copley_.pdf
 
ITB_2023_When_Your_Applications_Work_As_a_Team_Nathaniel_Francis.pdf
ITB_2023_When_Your_Applications_Work_As_a_Team_Nathaniel_Francis.pdfITB_2023_When_Your_Applications_Work_As_a_Team_Nathaniel_Francis.pdf
ITB_2023_When_Your_Applications_Work_As_a_Team_Nathaniel_Francis.pdf
 
ITB_2023_Faster_Apps_That_Wont_Get_Crushed_Brian_Klaas.pdf
ITB_2023_Faster_Apps_That_Wont_Get_Crushed_Brian_Klaas.pdfITB_2023_Faster_Apps_That_Wont_Get_Crushed_Brian_Klaas.pdf
ITB_2023_Faster_Apps_That_Wont_Get_Crushed_Brian_Klaas.pdf
 
ITB_2023_Chatgpt_Box_Scott_Steinbeck.pdf
ITB_2023_Chatgpt_Box_Scott_Steinbeck.pdfITB_2023_Chatgpt_Box_Scott_Steinbeck.pdf
ITB_2023_Chatgpt_Box_Scott_Steinbeck.pdf
 
ITB_2023_CommandBox_Task_Runners_Brad_Wood.pdf
ITB_2023_CommandBox_Task_Runners_Brad_Wood.pdfITB_2023_CommandBox_Task_Runners_Brad_Wood.pdf
ITB_2023_CommandBox_Task_Runners_Brad_Wood.pdf
 
ITB_2023_Create_as_many_web_sites_or_web_apps_as_you_want_George_Murphy.pdf
ITB_2023_Create_as_many_web_sites_or_web_apps_as_you_want_George_Murphy.pdfITB_2023_Create_as_many_web_sites_or_web_apps_as_you_want_George_Murphy.pdf
ITB_2023_Create_as_many_web_sites_or_web_apps_as_you_want_George_Murphy.pdf
 
ITB2023 Developing for Performance - Denard Springle.pdf
ITB2023 Developing for Performance - Denard Springle.pdfITB2023 Developing for Performance - Denard Springle.pdf
ITB2023 Developing for Performance - Denard Springle.pdf
 

Recently uploaded

AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 

Recently uploaded (20)

Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 

Into The Box 2018 | Content box + docker

  • 3. Docker Images ● Ortus Solutions has built and supports a few docker images, the most common and popular ○ ortussolutions/commandbox https://hub.docker.com/r/ortussolutions/commandbox/ ● Ortus Solutions has built one especially for ContentBox ○ Adds several bells and whistles to help get your ContentBox app ready to deploy to docker ○ ContentBox Image updated for Version 4.0 release.
  • 4. CommandBox Docker Image https://hub.docker.com/r/ortussolutions/commandbox/ ● Gives you commandbox, ready to go. ● Run any CF Engine or WAR file ● Use CFConfig to configure your cfml engine ● Use environment values for overrides ● Put your files in the /app directory and start the server of your choice Your app is yours, and how you set it up, config it, is all up to you.
  • 5. ContentBox Docker Image https://hub.docker.com/r/ortussolutions/contentbox/ ContentBox’s image is built upon CommandBox, so it’s everything plus: ● Datasource config ● Distributed caching for content, rss etc ● Environment Overrides for ContentBox settings ● Embedded H2 DB support ● And more
  • 8. ContentBox Image - Express version ● The express version uses an in memory H2 database. ● Perfect for setting up for testing. ● If you start with the express=true and install=true you can install a fresh contentbox site into the H2 database docker run -p 8080:8080 -e express=true -e install=true ortussolutions/contentbox
  • 9. ContentBox Image - Persisting Data Docker doesn’t care about your data / files. If you want to keep it, persist it. Here we mount 2 volumes into the H2 data folder and the media folder docker run -p 8080:8080 -e express=true -e install=true -v `pwd`/contentbox-db:/data/contentbox/db -v `pwd`/contentbox-media:/app/includes/shared/media ortussolutions/contentbox
  • 10. ContentBox Image - Environment Variables This image allows you to pass in a series of environment variables to default your values when installing ContentBox ● Express ● Install ● FWREINIT_PW ● SESSION_STORAGE ● DISTRIBUTED_CACHE ● H2_DIR ● contentbox_default_* ● ORM_SECONDARY_CACHE ● ORM_DIALECT
  • 11. ContentBox Image - Database Connections ● To programmatically configure the database on container start, environment variables which represent your datasource configuration should be provided. There are two patterns supported: ○ DB_DRIVER configuration - which may be used for Adobe Coldfusion servers ○ DB_CLASS configuration - which configures a datasource by JDBC driver and connection string.
  • 12. ContentBox Image - Database Connections MYSQL Setup docker run -p 8080:8080 -e 'express=true' -e 'installer=true' -e 'cfconfig_adminPassword=myS3cur3P455' -e "DB_CONNECTION_STRING=jdbc:mysql://mysqlhost:3306/contentbox_docker?useUnicode=true&characterEncoding=UT F-8&useLegacyDatetimeCode=true" -e 'DB_CLASS=org.gjt.mm.mysql.Driver' -e 'DB_USER=contentbox_user' -e 'DB_PASSWORD=myS3cur3P455' -v `pwd`/contentbox-media:/app/includes/shared/media ortussolutions/contentbox
  • 13. ContentBox Image - Database Connections MSSQL Setup on Adobe docker run -p 8080:8080 -e 'CFENGINE=adobe@11' -e 'installer=true' -e 'cfconfig_adminPassword=myS3cur3P455' -e 'DB_DRIVER=MSSQLServer' -e 'DB_HOST=sqlserver_host' -e 'DB_PORT=1433' -e 'DB_NAME=contentbox_docker' -e 'DB_USER=sa' -e 'DB_PASSWORD=myS3cur3P455' -v `pwd`/contentbox-media:/app/includes/shared/media ortussolutions/contentbox
  • 14. ContentBox Image - Distributed Cache ● By default, this image is configured to use the connected database as a caching storage as well. This will allow you to distribute your stack with pseudo-caching enabled. ● However, if you would like to have a real distributed cache like Redis or Couchbase connected to your images, you will need to use the appropriate CacheBox providers and your own custom CacheBox.cfc configuration file. For an example of using Redis, check out our compose repository: https://github.com/Ortus-Solutions/docker-contentbox-distributed
  • 15. What if I have a ContentBox site already? Two Options ● Extract your changes from your old site and mount/copy them into ContentBox’s Docker Image - let’s look at that first ● Update your existing site to use some ContentBox Docker Image magic - we’ll look at this in a little while
  • 16. Let’s startup a site with ContentBox image ● docker run -p 8080:8080 -e 'cfconfig_adminPassword=password' -e "DB_CLASS=org.gjt.mm.mysql.Driver" -e "DB_CONNECTION_STRING=jdbc:mysql://172.17.0.4:3306/golfgk?useUnicode= true&characterEncoding=UTF-8&useLegacyDatetimeCode=true" -e "DB_USER=root" -e "DB_PASSWORD=secretpassword" ortussolutions/contentbox http://127.0.0.1:8080/
  • 17. Folder Structure - Where are my Files? Working with Docker where everything is in the image already is a little weird to say the least. You only need what is different in your local files ● Mount the persistent files as a volume ● Mount / Copy the Changes
  • 18. Let’s add our Media into the Image docker run -p 8080:8080 -e 'cfconfig_adminPassword=password' -e "DB_CLASS=org.gjt.mm.mysql.Driver" -e "DB_CONNECTION_STRING=jdbc:mysql://172.17.0.4:3306/golfgk?useUnicode=true&characterE ncoding=UTF-8&useLegacyDatetimeCode=true" -e "DB_USER=root" -e "DB_PASSWORD=r3@lc@m@" -v c:/www/__docker_contentbox/contentbox-media:/app/includes/shared/media ortussolutions/contentbox http://127.0.0.1:8080/
  • 19. Let’s add our Theme into the Image docker run -p 8080:8080 -e 'cfconfig_adminPassword=password' -e "DB_CLASS=org.gjt.mm.mysql.Driver" -e "DB_CONNECTION_STRING=jdbc:mysql://172.17.0.4:3306/golfgk?useUnicode=true&characterE ncoding=UTF-8&useLegacyDatetimeCode=true" -e "DB_USER=root" -e "DB_PASSWORD=r3@lc@m@" -v c:/www/__docker_contentbox/contentbox-media:/app/includes/shared/media -v c:/www/__docker_contentbox/themes/golfnk:/app/modules_app/contentbox-custom/_themes/golfnk ortussolutions/contentbox http://127.0.0.1:8080/
  • 20. Add Magic into Existing Site How does ContentBox’s Docker Image do all of this? ● Secret - Some of this is already in ContentBox 3.7.x & more in 4.x ● You need some functions added to your Application.cfc ● You need some config added to your config/Coldbox.cfc ● You need some config added to your config/CacheBox.cfc Let’s get into it.
  • 21. ContentBox’s ModuleConfig.cfc New functions in the ModuleConfig.cfc https://github.com/Ortus-Solutions/ContentBox/blob/development/modules/contentbox/Modul eConfig.cfc#L118
  • 22. ContentBox’s Application.cfc New in Docker Image https://github.com/Ortus-Solutions/docker-contentbox/blob/development/resources /app/Application.cfc Get Environment Variables from Java https://github.com/Ortus-Solutions/docker-contentbox/blob/development/resources /app/Application.cfc#L20
  • 23. ContentBox’s Application.cfc ( 2 ) SessionStorage from Env Variable https://github.com/Ortus-Solutions/docker-contentbox/blob/development/resources /app/Application.cfc#L20 Include Datasource Mixin https://github.com/Ortus-Solutions/docker-contentbox/blob/development/resources /app/Application.cfc#L56
  • 24. ContentBox’s Application.cfc ( 3 ) Secondary ORM Cache https://github.com/Ortus-Solutions/docker-contentbox/blob/development/resources /app/Application.cfc#L70
  • 25. ContentBox’s Coldbox.cfc New in Docker Image https://github.com/Ortus-Solutions/docker-contentbox/blob/development/resources /app/config/Coldbox.cfc Load Java Env Variables https://github.com/Ortus-Solutions/docker-contentbox/blob/development/resources /app/config/Coldbox.cfc#L14
  • 26. ContentBox’s Coldbox.cfc ( 2 ) FW Reinit Password https://github.com/Ortus-Solutions/docker-contentbox/blob/development/resources /app/config/Coldbox.cfc#L22 Distributed Cache Setting https://github.com/Ortus-Solutions/docker-contentbox/blob/development/resources /app/config/Coldbox.cfc#L98
  • 27. ContentBox’s Coldbox.cfc ( 3 ) Distributed Sessions https://github.com/Ortus-Solutions/docker-contentbox/blob/development/resources /app/config/Coldbox.cfc#L117 ContentBox Runtime Overrides https://github.com/Ortus-Solutions/docker-contentbox/blob/development/resources /app/config/Coldbox.cfc#L126
  • 28. ContentBox’s CacheBox.cfc Normal ContentBox Cachebox.cfc https://github.com/Ortus-Solutions/ContentBox/blob/development/config/CacheBo x.cfc New in Docker Image https://github.com/Ortus-Solutions/docker-contentbox/blob/development/resources /app/config/CacheBox.cfc
  • 29. ContentBox’s CacheBox.cfc ( 2 ) Session Cache set to the DB https://github.com/Ortus-Solutions/docker-contentbox/blob/development/resources /app/config/CacheBox.cfc#L55 New JDBC Cache setup for distributed Cache https://github.com/Ortus-Solutions/docker-contentbox/blob/development/resources /app/config/CacheBox.cfc#L71
  • 30. Live coding moment of truth Deploy to the Cloud!!!! docker run -d -p 8080:8080 -e 'cfconfig_adminPassword=password' -e "DB_CLASS=org.gjt.mm.mysql.Driver" -e "DB_CONNECTION_STRING=jdbc:mysql://204.48.54.78:3306/golfnk?useUnicode=true&characterEncod ing=UTF-8&useLegacyDatetimeCode=true" -e "DB_USER=secret" -e "DB_PASSWORD=topsecret" -v /mnt/volume-sfo2-01/contentbox-media:/app/includes/shared/media -v /mnt/volume-sfo2-01/themes/golfnk:/app/modules/contentbox/themes/golfnk gpickin/cb
  • 31. Live coding moment of truth Instance 2 docker run -d -p 8081:8080 -e 'cfconfig_adminPassword=password' -e "DB_CLASS=org.gjt.mm.mysql.Driver" -e "DB_CONNECTION_STRING=jdbc:mysql://204.48.54.78:3306/golfnk?useUnicode=true&characterEncod ing=UTF-8&useLegacyDatetimeCode=true" -e "DB_USER=secret" -e "DB_PASSWORD=topsecret" -v /mnt/volume-sfo2-01/contentbox-media:/app/includes/shared/media -v /mnt/volume-sfo2-01/themes/golfnk:/app/modules/contentbox/themes/golfnk gpickin/cb
  • 33. Want More? Docker Mastery Course - https://www.udemy.com/docker-mastery/ Ortus Solutions Website - https://www.ortussolutions.com/events Slack Channel - http://boxteam.herokuapp.com/ Twitter - https://twitter.com/ortussolutions/ CF Summit 2018 ( Las Vegas ) - Talk to us about a Training after the conference
  • 34. Thanks Thanks everyone There are a few more great sessions left, don’t miss out. Hope to see you all next year at Into the Box And CF Summit later in the year Travel Safe