📺 Develpreneur YouTube Episode

Video + transcript

WordPress On Docker - Part 1

2022-02-01 •Youtube

Detailed Notes

This series is a short set of tutorials on setting up a docker instance to run and develop your Wordpress installation.

Transcript Text
[Music]
all right so today we're going to look
at using docker again
and
like i said before this presentation
kind of came out of a necessity a need
for me to figure out how to
export a wordpress site from a live
production environment and actually
install it onto my mac m1 machine to
actually do some local development
tweaking before moving this site to
another live uh hosting environment and
since traditional vms did not work
i started looking at why
the industry wasn't
jumping the gun and getting on board
with getting the new virtual machines on
board with the arm chip
and as i started researching this and
digging into this i started to discover
that a lot of the
development industry a lot of our
developers or even testers have actually
kind of gotten away from the vm model a
little bit and have gone more with
docker or more with container based uh
system this way they can use things like
arm kubernetes docker to just quickly
throw up a
container and actually start working
with an application without having to
deal with the overhead of actually
building the operating system
so that is what our discussion is going
to be about today we're going to look at
uh
how to set up docker to host a wordpress
site we're going to export a live site
from hostgator
that's a wordpress site and run it
inside of our document container and if
we have time i will show you how to wrap
up the containers so that you can export
it to another site
quick review of docker
docker is essentially another tool like
kubernetes or
aws where it's designed to make it
easier to create deploy and run
applications using containers
and like i briefly said containers
are not vms they're just a package
containing all the parts of your
application
this will include things like your
libraries third-party dependencies
images basically all the files you need
to actually run the application without
the overhead of the operating system
and it also makes it easier for us to
wrap up these containers and deploy them
to any container-based environment
and again containers are not vm
and containers are not vms because
simply virtual machines
uh
typically virtual machines are
essentially full emulations of a full
operating machine so virtual machines
will run any software that runs on a
specific bare metal hardware like the
infill chip while providing isolation
from the real hardware so you kind of
have this virtual like a remote desktop
into a
machine but it's a virtual machine
and a vm can also host multiple
applications which will mix and match
over time versus
a container that is typically built for
a single application so you're basically
building your containers for one
application and virtual machines can run
multiple
and one way to think about this is
microsoft has kind of gone with this
approach with office 365. so your
container
or essentially your vm
in a windows environment is windows
well with their container approach with
their applications in with office 365
for example if you actually go out to
office 365 and open up microsoft word
microsoft word in that situation is
essentially your word container you can
open up multiple documents inside of
this container and in that kind of
situation your
word container
can then essentially have small
document containers inside of the
word container and if you have this on a
windows machine you can have word open
you can have excel open so you can have
multiple applications
also containers allow applications to
run in a container environment
they share an underlining operating
system well vrm systems uh can have
different operating systems
but it is possible to have a fixed set
of applications in a single container
using vm
all right some of the other things we're
going to talk about today so what is
wordpress and why do we care well
wordpress is one of the largest blogging
platforms in use today
it's a good online
technology
it's a good online open source website
creation tool this is what we use for
our developer nerd site i use it for my
doctor whose site velocity consulting
dave uses it for walmart consulting site
and pretty much any site on the web
where people actually produce a lot of
content is typically posted in some type
of wordpress
or crm type environment it's written in
php and designed for use with open
source technology such as the packing in
my table
which is perfect because this makes it
real easy for us to kind of wrap this
all inside of a container
all right so that's it for the quick
overview and slides we're going to jump
out now and we're actually going to do a
full hands-on demo today and we're going
to look at installing and setting up
docker we're going to go over some of
the docker command line commands using
docker compose which is going to
simplify a lot of our discussion today
if you want a more deeper dive into
doctor
or if this is your first time paying
doctor i recommend you go back into our
video library and look at our previous
presentations on how what docker is how
to set up doctor uh and kubernetes and
finally we're going to package and
deploy a live wordpress site my millage
consulting site from a live website to a
local container running on my
any questions at this point is everyone
clear on what we're going to be talking
about today
yes sir we're good
awesome
all right so
just a quick little bit of housekeeping
so first we're going to need to go to a
couple different sites uh if you don't
have docker installed you need to go to
docker.com
and look for the get started link
usually in the upper right hand corner
if you click this guy
you're going to be taken to the software
site
the main thing you want to be
concerned about is installing the docker
desktop
now
if you are a mac user
you need to be very specific on the
version you select if you have the new
macbook pro m1 chip do not install the
mac intel chip it will not work in fact
it will actually make your life a pain
because then you have to go find
libraries delete them all and then
reinstall the correct one which is the
download for the mac multiple tip
the m1
windows just download windows and linux
is easy it's just download the linux
doctor hub is not necessary for this
presentation but it is a nice place to
go uh to
upload your cloud-based applications
test them live in the cloud and there's
some other different pricing options
there again if you want to learn more
about this go back and check out the
doctor presentations that we've done
previously
next you want to make sure that you have
docker compose install
uh it is uh if you go to
basically i just did a quick google
search for this so if you google docker
compose
typically it's the first one you want
look for install docker compose and then
if you scroll down a little bit it'll
give you the tabs here for how to
install docker compose on the different
machines
it's a command line install typically
uh so i would use the directions for
your specific operating system
again i've covered this previously in
previous presentations but um if you
have not watched them uh these are the
two mandatory components that you need
to get started today
the other thing we're going to look at
real quickly before i get into the
docker
setup locally is we're going to look at
a lot my live website
elashconsulting.com so this is my
personal consulting business melange
consulting this is a wordpress site that
i put together to market my
business and it's got some basic
information all built in php on the back
end it is
wordpress
so in order for us to easily
export this live wordpress site i
recommend going to the plugins page
and do a search for all in one
search for the plugin and what we want
is we want this all-in-one wordpress
migration
so you want to make sure that you find
this plugin and install it on your site
and then when you go to their little
how-to or help pop up here they'll walk
you through okay install it add it and
then go through the install activities
and then if you go out to their actual
screenshots and reviews it walks you
through how to actually
use the tool
it's actually real easy really
straightforward so if you go to want to
install it you go to the all in one
wordpress migration
go to export
and then you just click add
if you want to add specific content or
you can just do export to
and tell it hey uh export my entire site
so if you don't add anything it will
export everything
you can say file ftp dropbox
uh depending upon the server you are
hosting wordpress on
the file option may not be
viable because you may not have enough
disk space on your hosting provider to
actually export the site to it so you
might want to look at some other options
like maybe up to dropbox
or one of these other private
if you do have a large
production box by all means do file
otherwise you might just want to install
ftp zilla
and
or filezilla and use that to host a ftp
server locally and just export your
files from your site to your local
machine
for now i'll just select file it's going
to go through it's going to analyze the
site uh tell you where you might have
some problems for exporting
and then you just kind of go through and
check the boxes and continue to you get
down to export the file
i'm not going to walk through that
because this will take a
little bit of time uh if you want to
again see
all the different pieces
or walk through the components you can
just go to their plugins
and if we look at your details
screenshots so you start by exporting
your site
you can then uh filter out you know do
not export spam content so you can
remove uh media that you don't want
import same kind of thing you just take
the file and stick it in
so once you do export you select file
and then it just basically goes through
and you have a couple uh additional
screens
once the files
created you then download it to your
environment your local machine or to
your new production environment that's
how quick and easy it is to export your
wordpress site
uh there are more complex more advanced
ways to do it but for a typical simple
migration like this this tool is perfect
it's free and it will do 99 of what you
need
but once you are done it generates the
file you download your file and then you
move over to your local environment
okay
and i will just start with dr diphthong
so if we go to doctor desktop
so if you've gone through the doctor's
site installed your local doctor
environment doctor desktop it will ask
you to log in
it's free go ahead and create your
account sign in
it's actually neat because even with the
free plan you have the capabilities of
uploading to the doctor hub and you can
test out your
containers live
in the cloud
there's some additional settings you can
do here if you want but we're not going
to get into those today
again more details on the doctor
container and doctor go check that our
previous person
all right so i've started out clean i've
removed all my local doctor containers
for now for this presentation so right
now my containers and apps are empty
my images are empty i have no docker
images currently loaded and i have no
vertical
drives for or volumes for my factory
containers
so what we need to do is we need to go
out to our command line
and the bird but actually before we do
this
so let me so the first thing we actually
want to make sure we want to make sure
that we have doctor compose installed so
for that we will type docker
compose
sd
and it tells me yes i have docker
compose version 129.2 installed
and
so once we have document compose
installed we actually need to build a
docker compose file
so i will go out to my development
environment
so
i am in my users
um
development i create a specific
workspace for my doctor
environments
and i've created a wordpress folder so
inside of this folder
clean that guy up
even though i cleared out my volumes my
test code was still there
and i'll explain what all those files
are in just a second
you
Transcript Segments
0.42

[Music]

27.119

all right so today we're going to look

30.4

at using docker again

32.16

and

34.239

like i said before this presentation

36.64

kind of came out of a necessity a need

39.68

for me to figure out how to

42.8

export a wordpress site from a live

45.36

production environment and actually

47.12

install it onto my mac m1 machine to

50.48

actually do some local development

52.079

tweaking before moving this site to

54.48

another live uh hosting environment and

58.559

since traditional vms did not work

61.92

i started looking at why

64.799

the industry wasn't

67.04

jumping the gun and getting on board

69.119

with getting the new virtual machines on

71.92

board with the arm chip

74.96

and as i started researching this and

77.119

digging into this i started to discover

79.439

that a lot of the

81.6

development industry a lot of our

83.84

developers or even testers have actually

86.56

kind of gotten away from the vm model a

89.52

little bit and have gone more with

91.52

docker or more with container based uh

94.56

system this way they can use things like

97.04

arm kubernetes docker to just quickly

100.079

throw up a

102.24

container and actually start working

104.56

with an application without having to

106.079

deal with the overhead of actually

107.52

building the operating system

110.32

so that is what our discussion is going

111.84

to be about today we're going to look at

114

uh

114.799

how to set up docker to host a wordpress

117.2

site we're going to export a live site

120.799

from hostgator

122.88

that's a wordpress site and run it

125.6

inside of our document container and if

127.68

we have time i will show you how to wrap

129.599

up the containers so that you can export

131.52

it to another site

135.12

quick review of docker

136.959

docker is essentially another tool like

140.319

kubernetes or

142.4

aws where it's designed to make it

145.52

easier to create deploy and run

147.28

applications using containers

151.2

and like i briefly said containers

153.76

are not vms they're just a package

157.2

containing all the parts of your

158.959

application

160.56

this will include things like your

161.84

libraries third-party dependencies

164.4

images basically all the files you need

166.319

to actually run the application without

168.4

the overhead of the operating system

171.12

and it also makes it easier for us to

173.28

wrap up these containers and deploy them

175.28

to any container-based environment

178.159

and again containers are not vm

182.159

and containers are not vms because

184.159

simply virtual machines

188.72

uh

190.239

typically virtual machines are

192.159

essentially full emulations of a full

194.8

operating machine so virtual machines

197.04

will run any software that runs on a

198.959

specific bare metal hardware like the

201.76

infill chip while providing isolation

204.159

from the real hardware so you kind of

206.72

have this virtual like a remote desktop

209.12

into a

210.4

machine but it's a virtual machine

213.04

and a vm can also host multiple

215.44

applications which will mix and match

217.68

over time versus

219.36

a container that is typically built for

222.239

a single application so you're basically

224.72

building your containers for one

227.2

application and virtual machines can run

230.159

multiple

231.599

and one way to think about this is

234.08

microsoft has kind of gone with this

235.519

approach with office 365. so your

238.159

container

240.239

or essentially your vm

242.319

in a windows environment is windows

245.92

well with their container approach with

248.319

their applications in with office 365

251.28

for example if you actually go out to

253.2

office 365 and open up microsoft word

256.4

microsoft word in that situation is

259.68

essentially your word container you can

262.8

open up multiple documents inside of

265.199

this container and in that kind of

267.52

situation your

270.08

word container

272.639

can then essentially have small

274.72

document containers inside of the

278.08

word container and if you have this on a

280.96

windows machine you can have word open

283.199

you can have excel open so you can have

284.72

multiple applications

288.96

also containers allow applications to

291.6

run in a container environment

295.12

they share an underlining operating

297.36

system well vrm systems uh can have

300.639

different operating systems

303.36

but it is possible to have a fixed set

305.68

of applications in a single container

307.84

using vm

312.16

all right some of the other things we're

313.28

going to talk about today so what is

315.12

wordpress and why do we care well

317.44

wordpress is one of the largest blogging

319.759

platforms in use today

323.039

it's a good online

326.24

technology

327.6

it's a good online open source website

329.6

creation tool this is what we use for

331.6

our developer nerd site i use it for my

333.199

doctor whose site velocity consulting

335.6

dave uses it for walmart consulting site

338.32

and pretty much any site on the web

340.32

where people actually produce a lot of

342.32

content is typically posted in some type

344.8

of wordpress

346.16

or crm type environment it's written in

348.88

php and designed for use with open

350.88

source technology such as the packing in

352.88

my table

354.24

which is perfect because this makes it

355.68

real easy for us to kind of wrap this

357.68

all inside of a container

360.96

all right so that's it for the quick

362.8

overview and slides we're going to jump

365.919

out now and we're actually going to do a

367.44

full hands-on demo today and we're going

369.919

to look at installing and setting up

371.6

docker we're going to go over some of

373.44

the docker command line commands using

377.039

docker compose which is going to

378.639

simplify a lot of our discussion today

382.319

if you want a more deeper dive into

384.88

doctor

386.16

or if this is your first time paying

387.84

doctor i recommend you go back into our

389.759

video library and look at our previous

392.8

presentations on how what docker is how

395.759

to set up doctor uh and kubernetes and

398.96

finally we're going to package and

400.8

deploy a live wordpress site my millage

402.96

consulting site from a live website to a

406.72

local container running on my

412.56

any questions at this point is everyone

414.319

clear on what we're going to be talking

415.919

about today

422.319

yes sir we're good

424.56

awesome

426.08

all right so

427.44

just a quick little bit of housekeeping

429.919

so first we're going to need to go to a

432.88

couple different sites uh if you don't

435.52

have docker installed you need to go to

437.36

docker.com

440

and look for the get started link

442.24

usually in the upper right hand corner

444.24

if you click this guy

445.84

you're going to be taken to the software

448.24

site

449.12

the main thing you want to be

451.84

concerned about is installing the docker

454

desktop

455.28

now

457.599

if you are a mac user

460.319

you need to be very specific on the

462.8

version you select if you have the new

465.039

macbook pro m1 chip do not install the

468.08

mac intel chip it will not work in fact

471.44

it will actually make your life a pain

473.84

because then you have to go find

474.96

libraries delete them all and then

477.36

reinstall the correct one which is the

480

download for the mac multiple tip

482.479

the m1

483.919

windows just download windows and linux

486.96

is easy it's just download the linux

490

doctor hub is not necessary for this

493.199

presentation but it is a nice place to

495.44

go uh to

497.28

upload your cloud-based applications

499.759

test them live in the cloud and there's

501.68

some other different pricing options

503.68

there again if you want to learn more

505.599

about this go back and check out the

508.4

doctor presentations that we've done

510.08

previously

516.56

next you want to make sure that you have

519.12

docker compose install

521.279

uh it is uh if you go to

524.959

basically i just did a quick google

526.56

search for this so if you google docker

531.76

compose

533.04

typically it's the first one you want

535.44

look for install docker compose and then

538.32

if you scroll down a little bit it'll

540

give you the tabs here for how to

542.32

install docker compose on the different

544.24

machines

546.08

it's a command line install typically

549.44

uh so i would use the directions for

551.76

your specific operating system

554.959

again i've covered this previously in

556.88

previous presentations but um if you

559.12

have not watched them uh these are the

561.6

two mandatory components that you need

563.6

to get started today

566.399

the other thing we're going to look at

568.24

real quickly before i get into the

570

docker

571.12

setup locally is we're going to look at

573.6

a lot my live website

575.56

elashconsulting.com so this is my

578.959

personal consulting business melange

580.64

consulting this is a wordpress site that

582.88

i put together to market my

585.2

business and it's got some basic

587.279

information all built in php on the back

590.48

end it is

592.56

wordpress

594.399

so in order for us to easily

597.36

export this live wordpress site i

600.16

recommend going to the plugins page

605.04

and do a search for all in one

615.76

search for the plugin and what we want

618.8

is we want this all-in-one wordpress

621.68

migration

622.959

so you want to make sure that you find

624.959

this plugin and install it on your site

628.8

and then when you go to their little

630.72

how-to or help pop up here they'll walk

633.76

you through okay install it add it and

636.88

then go through the install activities

639.04

and then if you go out to their actual

640.88

screenshots and reviews it walks you

642.72

through how to actually

644.48

use the tool

646.48

it's actually real easy really

648.56

straightforward so if you go to want to

651.44

install it you go to the all in one

653.519

wordpress migration

655.519

go to export

658.32

and then you just click add

661.76

if you want to add specific content or

664.56

you can just do export to

666.959

and tell it hey uh export my entire site

670

so if you don't add anything it will

671.519

export everything

673.279

you can say file ftp dropbox

676.88

uh depending upon the server you are

679.2

hosting wordpress on

681.279

the file option may not be

684.959

viable because you may not have enough

687.92

disk space on your hosting provider to

690.079

actually export the site to it so you

692.72

might want to look at some other options

694.24

like maybe up to dropbox

696.399

or one of these other private

699.279

if you do have a large

701.68

production box by all means do file

705.12

otherwise you might just want to install

707.92

ftp zilla

709.6

and

710.48

or filezilla and use that to host a ftp

714.24

server locally and just export your

716.399

files from your site to your local

717.92

machine

719.76

for now i'll just select file it's going

722

to go through it's going to analyze the

723.68

site uh tell you where you might have

726.399

some problems for exporting

728.8

and then you just kind of go through and

730.32

check the boxes and continue to you get

732.959

down to export the file

735.519

i'm not going to walk through that

736.48

because this will take a

738.24

little bit of time uh if you want to

740.48

again see

741.76

all the different pieces

744.079

or walk through the components you can

746.399

just go to their plugins

749.76

and if we look at your details

754.32

screenshots so you start by exporting

756.56

your site

760.079

you can then uh filter out you know do

762.72

not export spam content so you can

764.639

remove uh media that you don't want

768.56

import same kind of thing you just take

770.32

the file and stick it in

772.48

so once you do export you select file

774.639

and then it just basically goes through

776.16

and you have a couple uh additional

777.92

screens

779.279

once the files

780.8

created you then download it to your

783.2

environment your local machine or to

785.12

your new production environment that's

787.44

how quick and easy it is to export your

790

wordpress site

791.44

uh there are more complex more advanced

794

ways to do it but for a typical simple

796.56

migration like this this tool is perfect

799.2

it's free and it will do 99 of what you

802.56

need

803.6

but once you are done it generates the

805.839

file you download your file and then you

808.399

move over to your local environment

813.04

okay

816.56

and i will just start with dr diphthong

819.36

so if we go to doctor desktop

821.92

so if you've gone through the doctor's

823.839

site installed your local doctor

825.839

environment doctor desktop it will ask

828.639

you to log in

829.92

it's free go ahead and create your

831.519

account sign in

833.12

it's actually neat because even with the

835.199

free plan you have the capabilities of

837.279

uploading to the doctor hub and you can

839.519

test out your

840.72

containers live

842.639

in the cloud

844.16

there's some additional settings you can

845.6

do here if you want but we're not going

847.68

to get into those today

850.56

again more details on the doctor

852.72

container and doctor go check that our

854.839

previous person

856.32

all right so i've started out clean i've

858.32

removed all my local doctor containers

861.12

for now for this presentation so right

863.04

now my containers and apps are empty

865.6

my images are empty i have no docker

868.24

images currently loaded and i have no

871.36

vertical

872.72

drives for or volumes for my factory

875.44

containers

877.36

so what we need to do is we need to go

879.12

out to our command line

880.8

and the bird but actually before we do

883.36

this

884.399

so let me so the first thing we actually

886.48

want to make sure we want to make sure

887.76

that we have doctor compose installed so

890.32

for that we will type docker

893.839

compose

895.839

sd

897.519

and it tells me yes i have docker

899.36

compose version 129.2 installed

903.12

and

904

so once we have document compose

905.44

installed we actually need to build a

907.44

docker compose file

909.519

so i will go out to my development

911.92

environment

929.839

so

931.6

i am in my users

934

um

934.8

development i create a specific

937.279

workspace for my doctor

939.36

environments

940.639

and i've created a wordpress folder so

943.6

inside of this folder

949.44

clean that guy up

952.959

even though i cleared out my volumes my

954.959

test code was still there

957.759

and i'll explain what all those files

959.279

are in just a second

976.399

you