SlideShare a Scribd company logo
Containerizing
ContentBox CMS
Gavin Pickin
●
About Me?
Who am I?
● Software Consultant for Ortus Solutions
● Work with ColdBox, CommandBox, ContentBox every day
● Working with Coldfusion for 20 years
● Working with Javascript just as long
● Love learning and sharing the lessons learned
● From New Zealand, live in Bakersfield, Ca
● Loving wife, lots of kids, and countless critters
http://www.gpickin.com and @gpickin on twitter
http://www.ortussolutions.com
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
● HEALTHCHECK_URI
● FWREINIT_PW
● SESSION_STORAGE
● DISTRIBUTED_CACHE
● H2_DIR
● contentbox_default_*
● ORM_SECONDARY_CACHE
● ORM_DIALECT
● REMOVE_CBADMIN
● JVM_HEAPSIZE
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 8888:8080 
-e 'INSTALL=true' 
-e 'CFCONFIG_ADMINPASSWORD=guardians' 
-e
"DB_CONNECTION_STRING=jdbc:mysql://itb.cloudgq.com:3306/thor?useUnicode=tru
e&characterEncoding=UTF-8&useLegacyDatetimeCode=true" 
-e 'DB_CLASS=org.gjt.mm.mysql.Driver' 
-e 'DB_USER=thor 
-e 'DB_PASSWORD=topsecret’ 
ortussolutions/contentbox
http://127.0.0.1:8888/
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 8888:8080 
-e 'INSTALL=true' -e 'CFCONFIG_ADMINPASSWORD=guardians' -e
"DB_CONNECTION_STRING=jdbc:mysql://itb.cloudgq.com:3306/thor?useUnicode=true&cha
racterEncoding=UTF-8&useLegacyDatetimeCode=true" 
-e 'DB_CLASS=org.gjt.mm.mysql.Driver' 
-e 'DB_USER=thor 
-e 'DB_PASSWORD=topsecret’ 
-v c:/www/contentbox-zero-to-hero/media:/app/includes/shared/media
ortussolutions/contentbox
http://127.0.0.1:8888
Let’s add our ContentBox-Custom folder into the
Image
docker run -p 8888:8080
-e 'INSTALL=true' -e 'CFCONFIG_ADMINPASSWORD=guardians' -e
"DB_CONNECTION_STRING=jdbc:mysql://itb.cloudgq.com:3306/starlord?useUnicode=true&am
p;characterEncoding=UTF-8&useLegacyDatetimeCode=true"
-e 'DB_CLASS=org.gjt.mm.mysql.Driver'
-e 'DB_USER=starlord'
-e 'DB_PASSWORD=starlord'
-v c:/www/contentbox-zero-to-hero/media:/app/includes/shared/media -v
C:/www/contentbox-zero-to-hero/itb-1/modules_app/contentbox-custom:/app/modules_app/co
ntentbox-custom ortussolutions/contentbox
http://127.0.0.1:8888/
Live coding moment of truth
Deploy to the Cloud!!!!
Want to try it out, use my link and get $100 in credit to play with
https://m.do.co/c/7fd11f7cfdf2
Live coding moment of truth
Deploy to the Cloud!!!!
First, we need to get the files to the server.
Lets just use SSH Copy for now, or FTP, because that’s how it’s done, right?
We’ll upload them into /contentbox-zero-to-hero
/contentbox-hero-to-zero/media
/contentbox-hero-to-zero/itb-1/modules_app/contentbox-custom
Live coding moment of truth
Deploy to the Cloud!!!!
docker run -p 8888:8080 -e 'INSTALL=true' -e 'CFCONFIG_ADMINPASSWORD=guardians' -e
"DB_CONNECTION_STRING=jdbc:mysql://itb.cloudgq.com:3306/starlord?useUnicode=true&char
acterEncoding=UTF-8&useLegacyDatetimeCode=true" -e 'DB_CLASS=org.gjt.mm.mysql.Driver' -e
'DB_USER=starlord' -e 'DB_PASSWORD=starlord' -v
/contentbox-zero-to-hero/media:/app/includes/shared/media -v
/contentbox-zero-to-hero/itb-1/modules_app/contentbox-custom:/app/modules_app/contentbox-custom
ortussolutions/contentbox
http://dockerdemo.cloudgq.com:8888
Clustering your Docker Images
That’s what Docker is great for… and Docker Swarm is a great way to get
started.
Things to Consider
Files - Any files you have would need to be persisted to a shared drive between servers,
block storage on Digital ocean works great here ( show example )
Sessions - Sessions are usually stored in the server memory, more servers means more
memory not the same memory.
Baking your code into Docker Images
Having to share your code on every server, or putting it on a shared drive is not a
good workflow.
Your code should only change when you deploy a new version.
Things that change in your app, need to be separated like Media, etc
So lets build a docker image with our Content.
Docker File
FROM ortussolutions/contentbox
COPY modules_app/contentbox-custom /app/modules_app/contentbox-custom
Build a Docker Image with Docker File
docker build -t gpickin/itb-docker-demo:20190503.0.1 .
Push our Docker image to Docker Hub
docker push gpickin/itb-docker-demo:20190503.0.1
Docker Run with our Built Image locally
docker run -p 8888:8080 -e 'INSTALL=true' -e
'CFCONFIG_ADMINPASSWORD=guardians' -e
"DB_CONNECTION_STRING=jdbc:mysql://itb.cloudgq.com:3306/starlord?useUnicode=tru
e&characterEncoding=UTF-8&useLegacyDatetimeCode=true" -e
'DB_CLASS=org.gjt.mm.mysql.Driver' -e 'DB_USER=starlord' -e
'DB_PASSWORD=starlord' -v
c:/www/contentbox-zero-to-hero/media:/app/includes/shared/media
gpickin/itb-docker-demo:20190503.0.1
Docker Run with our Built Image on DO
docker run -p 8888:8080 -e 'INSTALL=true' -e
'CFCONFIG_ADMINPASSWORD=guardians' -e
"DB_CONNECTION_STRING=jdbc:mysql://itb.cloudgq.com:3306/starlord?useUnicode=tru
e&characterEncoding=UTF-8&useLegacyDatetimeCode=true" -e
'DB_CLASS=org.gjt.mm.mysql.Driver' -e 'DB_USER=starlord' -e
'DB_PASSWORD=starlord' -v /contentbox-zero-to-hero/media:/app/includes/shared/media
-v
/contentbox-zero-to-hero/itb-1/modules_app/contentbox-custom:/app/modules_app/content
box-custom gpickin/itb-docker-demo:20190503.0.1
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 2019 ( 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

PDF
Into The Box 2018 | Content box + docker
PDF
Composer Tools & Frameworks for Drupal
PDF
Coscup x ruby conf tw 2021 google cloud buildpacks 剖析與實踐
PDF
Varnish - PLNOG 4
PDF
開放運算&GPU技術研究班
PDF
Caching with Varnish
PDF
Hiveminder - Everything but the Secret Sauce
ODP
Docker for Developers
Into The Box 2018 | Content box + docker
Composer Tools & Frameworks for Drupal
Coscup x ruby conf tw 2021 google cloud buildpacks 剖析與實踐
Varnish - PLNOG 4
開放運算&GPU技術研究班
Caching with Varnish
Hiveminder - Everything but the Secret Sauce
Docker for Developers

What's hot (20)

PDF
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
PDF
Living the Nomadic life - Nic Jackson
PDF
Drush in the Composer Era
ODP
Docker for PHP Developers - php[world] 2017
PDF
Configuring Django projects for multiple environments
PDF
Script it
PDF
MySQL in your laptop
PDF
Challenges of container configuration
PDF
Varnish Configuration Step by Step
PPTX
Real World Experience of Running Docker in Development and Production
PDF
Taming the Cloud Database with Apache jclouds, ApacheCon Europe 2014
PPT
Drupal 7 Deployment Using Apache Ant. Dmitriy Svetlichniy.
PDF
JavaOne 2014: Taming the Cloud Database with jclouds
PPTX
Running Docker in Development & Production (DevSum 2015)
PPTX
Real World Lessons on the Pain Points of Node.js Applications
PDF
Making environment for_infrastructure_as_code
PPTX
Running Docker in Development & Production (#ndcoslo 2015)
PDF
Docker workshop 0507 Taichung
PPTX
ABCs of docker
PDF
Continuous delivery w projekcie open source - Marcin Stachniuk
Hands on Docker - Launch your own LEMP or LAMP stack - SunshinePHP
Living the Nomadic life - Nic Jackson
Drush in the Composer Era
Docker for PHP Developers - php[world] 2017
Configuring Django projects for multiple environments
Script it
MySQL in your laptop
Challenges of container configuration
Varnish Configuration Step by Step
Real World Experience of Running Docker in Development and Production
Taming the Cloud Database with Apache jclouds, ApacheCon Europe 2014
Drupal 7 Deployment Using Apache Ant. Dmitriy Svetlichniy.
JavaOne 2014: Taming the Cloud Database with jclouds
Running Docker in Development & Production (DevSum 2015)
Real World Lessons on the Pain Points of Node.js Applications
Making environment for_infrastructure_as_code
Running Docker in Development & Production (#ndcoslo 2015)
Docker workshop 0507 Taichung
ABCs of docker
Continuous delivery w projekcie open source - Marcin Stachniuk
Ad

Similar to ITB2019 Containerizing ContentBox CMS - Gavin Pickin (20)

PPTX
Containerizing ContentBox CMS
PDF
Docker primer and tips
PDF
Introduction to Docker and Monitoring with InfluxData
PDF
Docker for Developers
PDF
Learning Docker with Thomas
PDF
Boosting Sitecore Development With Sitecore Docker
PDF
PDXPortland - Dockerize Django
PDF
DCSF 19 Building Your Development Pipeline
PDF
Perspectives on Docker
PDF
MySQL docker with demo by Ramana Yeruva
PDF
ContainerDayVietnam2016: Dockerize a small business
PDF
Magento Docker Setup.pdf
PDF
Adrian Mouat - Docker Tips and Tricks
PPTX
Improving build solutions dependency management with webpack
PDF
Docker Introduction.pdf
PPTX
Docker for Web Developers: A Sneak Peek
PPTX
PDF
Docker workshop GDSC_CSSC
PDF
Using Docker For Development
PDF
How to Dockerize Web Application using Docker Compose
Containerizing ContentBox CMS
Docker primer and tips
Introduction to Docker and Monitoring with InfluxData
Docker for Developers
Learning Docker with Thomas
Boosting Sitecore Development With Sitecore Docker
PDXPortland - Dockerize Django
DCSF 19 Building Your Development Pipeline
Perspectives on Docker
MySQL docker with demo by Ramana Yeruva
ContainerDayVietnam2016: Dockerize a small business
Magento Docker Setup.pdf
Adrian Mouat - Docker Tips and Tricks
Improving build solutions dependency management with webpack
Docker Introduction.pdf
Docker for Web Developers: A Sneak Peek
Docker workshop GDSC_CSSC
Using Docker For Development
How to Dockerize Web Application using Docker Compose
Ad

More from Ortus Solutions, Corp (20)

PDF
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
PDF
June Webinar: BoxLang-Dynamic-AWS-Lambda
PDF
BoxLang-Dynamic-AWS-Lambda by Luis Majano.pdf
PDF
What's-New-with-BoxLang-Brad Wood.pptx.pdf
PDF
Getting Started with BoxLang - CFCamp 2025.pdf
PDF
CFCamp2025 - Keynote Day 1 led by Luis Majano.pdf
PDF
What's New with BoxLang Led by Brad Wood.pdf
PDF
Vector Databases and the BoxLangCFML Developer.pdf
PDF
Using cbSSO in a ColdBox App Led by Jacob Beers.pdf
PDF
Use JSON to Slash Your Database Performance.pdf
PDF
Portable CI wGitLab and Github led by Gavin Pickin.pdf
PDF
Tame the Mesh An intro to cross-platform tracing and troubleshooting.pdf
PDF
Supercharging CommandBox with Let's Encrypt.pdf
PDF
Spice up your site with cool animations using GSAP..pdf
PDF
Passkeys and cbSecurity Led by Eric Peterson.pdf
PDF
Legacy Code Nightmares , Hellscapes, and Lessons Learned.pdf
PDF
Integrating the OpenAI API in Your Coldfusion Apps.pdf
PDF
Hidden Gems in FusionReactor for BoxLang, ACF, and Lucee Users.pdf
PDF
Geting-started with BoxLang Led By Raymon Camden.pdf
PDF
From Zero to CRUD with ORM - Led by Annette Liskey.pdf
TheFutureIsDynamic-BoxLang witch Luis Majano.pdf
June Webinar: BoxLang-Dynamic-AWS-Lambda
BoxLang-Dynamic-AWS-Lambda by Luis Majano.pdf
What's-New-with-BoxLang-Brad Wood.pptx.pdf
Getting Started with BoxLang - CFCamp 2025.pdf
CFCamp2025 - Keynote Day 1 led by Luis Majano.pdf
What's New with BoxLang Led by Brad Wood.pdf
Vector Databases and the BoxLangCFML Developer.pdf
Using cbSSO in a ColdBox App Led by Jacob Beers.pdf
Use JSON to Slash Your Database Performance.pdf
Portable CI wGitLab and Github led by Gavin Pickin.pdf
Tame the Mesh An intro to cross-platform tracing and troubleshooting.pdf
Supercharging CommandBox with Let's Encrypt.pdf
Spice up your site with cool animations using GSAP..pdf
Passkeys and cbSecurity Led by Eric Peterson.pdf
Legacy Code Nightmares , Hellscapes, and Lessons Learned.pdf
Integrating the OpenAI API in Your Coldfusion Apps.pdf
Hidden Gems in FusionReactor for BoxLang, ACF, and Lucee Users.pdf
Geting-started with BoxLang Led By Raymon Camden.pdf
From Zero to CRUD with ORM - Led by Annette Liskey.pdf

Recently uploaded (20)

PPTX
Cloud computing and distributed systems.
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
KodekX | Application Modernization Development
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Empathic Computing: Creating Shared Understanding
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
Cloud computing and distributed systems.
Dropbox Q2 2025 Financial Results & Investor Presentation
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
20250228 LYD VKU AI Blended-Learning.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
The AUB Centre for AI in Media Proposal.docx
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Spectral efficient network and resource selection model in 5G networks
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Understanding_Digital_Forensics_Presentation.pptx
KodekX | Application Modernization Development
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Digital-Transformation-Roadmap-for-Companies.pptx
Chapter 3 Spatial Domain Image Processing.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Empathic Computing: Creating Shared Understanding
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
“AI and Expert System Decision Support & Business Intelligence Systems”
Diabetes mellitus diagnosis method based random forest with bat algorithm

ITB2019 Containerizing ContentBox CMS - Gavin Pickin

  • 3. Who am I? ● Software Consultant for Ortus Solutions ● Work with ColdBox, CommandBox, ContentBox every day ● Working with Coldfusion for 20 years ● Working with Javascript just as long ● Love learning and sharing the lessons learned ● From New Zealand, live in Bakersfield, Ca ● Loving wife, lots of kids, and countless critters http://www.gpickin.com and @gpickin on twitter http://www.ortussolutions.com
  • 4. 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.
  • 5. 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.
  • 6. 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
  • 9. 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
  • 10. 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
  • 11. 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 ● HEALTHCHECK_URI ● FWREINIT_PW ● SESSION_STORAGE ● DISTRIBUTED_CACHE ● H2_DIR ● contentbox_default_* ● ORM_SECONDARY_CACHE ● ORM_DIALECT ● REMOVE_CBADMIN ● JVM_HEAPSIZE
  • 12. 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.
  • 13. 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
  • 14. 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
  • 15. 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
  • 16. 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
  • 17. Let’s startup a site with ContentBox image ● docker run -p 8888:8080 -e 'INSTALL=true' -e 'CFCONFIG_ADMINPASSWORD=guardians' -e "DB_CONNECTION_STRING=jdbc:mysql://itb.cloudgq.com:3306/thor?useUnicode=tru e&characterEncoding=UTF-8&useLegacyDatetimeCode=true" -e 'DB_CLASS=org.gjt.mm.mysql.Driver' -e 'DB_USER=thor -e 'DB_PASSWORD=topsecret’ ortussolutions/contentbox http://127.0.0.1:8888/
  • 18. 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
  • 19. Let’s add our Media into the Image docker run -p 8888:8080 -e 'INSTALL=true' -e 'CFCONFIG_ADMINPASSWORD=guardians' -e "DB_CONNECTION_STRING=jdbc:mysql://itb.cloudgq.com:3306/thor?useUnicode=true&cha racterEncoding=UTF-8&useLegacyDatetimeCode=true" -e 'DB_CLASS=org.gjt.mm.mysql.Driver' -e 'DB_USER=thor -e 'DB_PASSWORD=topsecret’ -v c:/www/contentbox-zero-to-hero/media:/app/includes/shared/media ortussolutions/contentbox http://127.0.0.1:8888
  • 20. Let’s add our ContentBox-Custom folder into the Image docker run -p 8888:8080 -e 'INSTALL=true' -e 'CFCONFIG_ADMINPASSWORD=guardians' -e "DB_CONNECTION_STRING=jdbc:mysql://itb.cloudgq.com:3306/starlord?useUnicode=true&am p;characterEncoding=UTF-8&useLegacyDatetimeCode=true" -e 'DB_CLASS=org.gjt.mm.mysql.Driver' -e 'DB_USER=starlord' -e 'DB_PASSWORD=starlord' -v c:/www/contentbox-zero-to-hero/media:/app/includes/shared/media -v C:/www/contentbox-zero-to-hero/itb-1/modules_app/contentbox-custom:/app/modules_app/co ntentbox-custom ortussolutions/contentbox http://127.0.0.1:8888/
  • 21. Live coding moment of truth Deploy to the Cloud!!!! Want to try it out, use my link and get $100 in credit to play with https://m.do.co/c/7fd11f7cfdf2
  • 22. Live coding moment of truth Deploy to the Cloud!!!! First, we need to get the files to the server. Lets just use SSH Copy for now, or FTP, because that’s how it’s done, right? We’ll upload them into /contentbox-zero-to-hero /contentbox-hero-to-zero/media /contentbox-hero-to-zero/itb-1/modules_app/contentbox-custom
  • 23. Live coding moment of truth Deploy to the Cloud!!!! docker run -p 8888:8080 -e 'INSTALL=true' -e 'CFCONFIG_ADMINPASSWORD=guardians' -e "DB_CONNECTION_STRING=jdbc:mysql://itb.cloudgq.com:3306/starlord?useUnicode=true&char acterEncoding=UTF-8&useLegacyDatetimeCode=true" -e 'DB_CLASS=org.gjt.mm.mysql.Driver' -e 'DB_USER=starlord' -e 'DB_PASSWORD=starlord' -v /contentbox-zero-to-hero/media:/app/includes/shared/media -v /contentbox-zero-to-hero/itb-1/modules_app/contentbox-custom:/app/modules_app/contentbox-custom ortussolutions/contentbox http://dockerdemo.cloudgq.com:8888
  • 24. Clustering your Docker Images That’s what Docker is great for… and Docker Swarm is a great way to get started. Things to Consider Files - Any files you have would need to be persisted to a shared drive between servers, block storage on Digital ocean works great here ( show example ) Sessions - Sessions are usually stored in the server memory, more servers means more memory not the same memory.
  • 25. Baking your code into Docker Images Having to share your code on every server, or putting it on a shared drive is not a good workflow. Your code should only change when you deploy a new version. Things that change in your app, need to be separated like Media, etc So lets build a docker image with our Content.
  • 26. Docker File FROM ortussolutions/contentbox COPY modules_app/contentbox-custom /app/modules_app/contentbox-custom
  • 27. Build a Docker Image with Docker File docker build -t gpickin/itb-docker-demo:20190503.0.1 .
  • 28. Push our Docker image to Docker Hub docker push gpickin/itb-docker-demo:20190503.0.1
  • 29. Docker Run with our Built Image locally docker run -p 8888:8080 -e 'INSTALL=true' -e 'CFCONFIG_ADMINPASSWORD=guardians' -e "DB_CONNECTION_STRING=jdbc:mysql://itb.cloudgq.com:3306/starlord?useUnicode=tru e&characterEncoding=UTF-8&useLegacyDatetimeCode=true" -e 'DB_CLASS=org.gjt.mm.mysql.Driver' -e 'DB_USER=starlord' -e 'DB_PASSWORD=starlord' -v c:/www/contentbox-zero-to-hero/media:/app/includes/shared/media gpickin/itb-docker-demo:20190503.0.1
  • 30. Docker Run with our Built Image on DO docker run -p 8888:8080 -e 'INSTALL=true' -e 'CFCONFIG_ADMINPASSWORD=guardians' -e "DB_CONNECTION_STRING=jdbc:mysql://itb.cloudgq.com:3306/starlord?useUnicode=tru e&characterEncoding=UTF-8&useLegacyDatetimeCode=true" -e 'DB_CLASS=org.gjt.mm.mysql.Driver' -e 'DB_USER=starlord' -e 'DB_PASSWORD=starlord' -v /contentbox-zero-to-hero/media:/app/includes/shared/media -v /contentbox-zero-to-hero/itb-1/modules_app/contentbox-custom:/app/modules_app/content box-custom gpickin/itb-docker-demo:20190503.0.1
  • 32. 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 2019 ( Las Vegas ) - Talk to us about a Training after the conference
  • 33. 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