Docker Cookbook


Using Supervisor to Run WordPress in a Single Container | 27



Download 6,31 Mb.
Pdf ko'rish
bet32/260
Sana21.04.2022
Hajmi6,31 Mb.
#570749
1   ...   28   29   30   31   32   33   34   35   ...   260
Bog'liq
Docker Cookbook

1.15 Using Supervisor to Run WordPress in a Single Container | 27


See Also
• Supervisor 
documentation
• Docker Supervisor 
article
1.16 Running a WordPress Blog Using Two Linked
Containers
Problem
You want to run a 
WordPress
site with containers, but you do not want to run the
MySQL database in the same container as WordPress. You want to keep the concept
of separation of concerns in mind and decouple the various components of an appli‐
cation as much as possible.
Solution
You start two containers: one running WordPress using the official image from the
Docker Hub
, and one running the MySQL database. The two containers are linked
using the 
--link
option of the Docker CLI.
Start by pulling the latest images for 
WordPress
 and 
MySQL
:
$ docker pull wordpress:latest
$ docker pull mysql:latest
$ docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
mysql latest 9def920de0a2 4 days ago 282.9 MB
wordpress latest 93acfaf85c71 8 days ago 472.8 MB
Start a MySQL container, give it a name via the 
--name
CLI option, and set the
MYSQL_ROOT_PASSWORD
via an environment variable:
$ docker run --name mysqlwp -e MYSQL_ROOT_PASSWORD=wordpressdocker -d mysql
By not specifying the tag for the 
mysql
image, Docker automatically
chose the 
latest
tag, which is the one you downloaded specifically.
The container was daemonized with the 
-d
option.
You can now run a WordPress container based on the 
wordpress:latest
image. It will
be 
linked
to the MySQL container using the 
--link
option, which means that Docker
will automatically set up the networking so that the ports exposed by the MySQL con‐
tainer are reachable inside the WordPress container:

Download 6,31 Mb.

Do'stlaringiz bilan baham:
1   ...   28   29   30   31   32   33   34   35   ...   260




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish