{"id":2381,"date":"2022-03-31T00:26:27","date_gmt":"2022-03-31T08:26:27","guid":{"rendered":"https:\/\/tungle.ca\/?p=2381"},"modified":"2022-04-19T08:30:59","modified_gmt":"2022-04-19T16:30:59","slug":"using-docker-compose-to-deploy-wordpress","status":"publish","type":"post","link":"https:\/\/tungle.ca\/?p=2381","title":{"rendered":"Using Docker compose to deploy WordPress"},"content":{"rendered":"\n<p>I have demonstrated to use Ansible to deploy WordPress (https:\/\/tungle.ca\/?p=1252). However, it is more efficient to use Docker compose to deploy WordPress. <\/p>\n\n\n\n<p>+ Download the Latest Docker Version.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -L \"https:\/\/github.com\/docker\/compose\/releases\/download\/1.29.2\/docker-compose-$(uname -s)-$(uname -m)\" -o \/usr\/local\/bin\/docker-compose<\/code><\/pre>\n\n\n\n<p>+ Change file permission &amp; check docker version.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>chmod +x \/usr\/local\/bin\/docker-compose\ndocker\u2013compose --version<\/code><\/pre>\n\n\n\n<p>+ Create a sample docker-compose.yml file.<\/p>\n\n\n\n<p>Use the following link as a reference to create the docker-compose file.<\/p>\n\n\n\n<p><a href=\"https:\/\/docs.docker.com\/samples\/wordpress\/\">https:\/\/docs.docker.com\/samples\/wordpress\/<\/a><\/p>\n\n\n\n<p>Port forwarding the destination port 5547 on the docker node to port 80 on a docker container.<\/p>\n\n\n\n<p>Limit 2GB memory for running WordPress. <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"807\" height=\"649\" src=\"https:\/\/tungle.ca\/wp-content\/uploads\/2022\/04\/6.png\" alt=\"\" class=\"wp-image-2382\" srcset=\"https:\/\/tungle.ca\/wp-content\/uploads\/2022\/04\/6.png 807w, https:\/\/tungle.ca\/wp-content\/uploads\/2022\/04\/6-300x241.png 300w, https:\/\/tungle.ca\/wp-content\/uploads\/2022\/04\/6-768x618.png 768w, https:\/\/tungle.ca\/wp-content\/uploads\/2022\/04\/6-200x161.png 200w\" sizes=\"auto, (max-width: 807px) 100vw, 807px\" \/><\/figure>\n\n\n\n<p>+ Deploy WordPress by using Docker compose.<\/p>\n\n\n\n<p>docker-compose up -d<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"652\" src=\"https:\/\/tungle.ca\/wp-content\/uploads\/2022\/04\/7-1024x652.png\" alt=\"\" class=\"wp-image-2383\" srcset=\"https:\/\/tungle.ca\/wp-content\/uploads\/2022\/04\/7-1024x652.png 1024w, https:\/\/tungle.ca\/wp-content\/uploads\/2022\/04\/7-300x191.png 300w, https:\/\/tungle.ca\/wp-content\/uploads\/2022\/04\/7-768x489.png 768w, https:\/\/tungle.ca\/wp-content\/uploads\/2022\/04\/7-200x127.png 200w, https:\/\/tungle.ca\/wp-content\/uploads\/2022\/04\/7.png 1151w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Check a TCP port 5547 is running on the docker node.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"320\" src=\"https:\/\/tungle.ca\/wp-content\/uploads\/2022\/04\/9-1024x320.png\" alt=\"\" class=\"wp-image-2384\" srcset=\"https:\/\/tungle.ca\/wp-content\/uploads\/2022\/04\/9-1024x320.png 1024w, https:\/\/tungle.ca\/wp-content\/uploads\/2022\/04\/9-300x94.png 300w, https:\/\/tungle.ca\/wp-content\/uploads\/2022\/04\/9-768x240.png 768w, https:\/\/tungle.ca\/wp-content\/uploads\/2022\/04\/9-200x62.png 200w, https:\/\/tungle.ca\/wp-content\/uploads\/2022\/04\/9.png 1316w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Access to WordPress.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"840\" src=\"https:\/\/tungle.ca\/wp-content\/uploads\/2022\/04\/1-1024x840.png\" alt=\"\" class=\"wp-image-2385\" srcset=\"https:\/\/tungle.ca\/wp-content\/uploads\/2022\/04\/1-1024x840.png 1024w, https:\/\/tungle.ca\/wp-content\/uploads\/2022\/04\/1-300x246.png 300w, https:\/\/tungle.ca\/wp-content\/uploads\/2022\/04\/1-768x630.png 768w, https:\/\/tungle.ca\/wp-content\/uploads\/2022\/04\/1-200x164.png 200w, https:\/\/tungle.ca\/wp-content\/uploads\/2022\/04\/1.png 1203w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/tungle.ca\/wp-content\/uploads\/2022\/04\/5-1024x576.png\" alt=\"\" class=\"wp-image-2386\" srcset=\"https:\/\/tungle.ca\/wp-content\/uploads\/2022\/04\/5-1024x576.png 1024w, https:\/\/tungle.ca\/wp-content\/uploads\/2022\/04\/5-300x169.png 300w, https:\/\/tungle.ca\/wp-content\/uploads\/2022\/04\/5-768x432.png 768w, https:\/\/tungle.ca\/wp-content\/uploads\/2022\/04\/5-1536x864.png 1536w, https:\/\/tungle.ca\/wp-content\/uploads\/2022\/04\/5-200x112.png 200w, https:\/\/tungle.ca\/wp-content\/uploads\/2022\/04\/5.png 1919w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have demonstrated to use Ansible to deploy WordPress (https:\/\/tungle.ca\/?p=1252). However, it is more efficient to use Docker compose to deploy WordPress. + Download the Latest Docker Version. + Change file permission &amp; check docker version. + Create a sample docker-compose.yml file. Use the following link as a reference to create the docker-compose file. https:\/\/docs.docker.com\/samples\/wordpress\/ [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28,6],"tags":[32,26],"class_list":["post-2381","post","type-post","status-publish","format-standard","hentry","category-docker","category-linux","tag-clinux","tag-docker"],"_links":{"self":[{"href":"https:\/\/tungle.ca\/index.php?rest_route=\/wp\/v2\/posts\/2381","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tungle.ca\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tungle.ca\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tungle.ca\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tungle.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2381"}],"version-history":[{"count":3,"href":"https:\/\/tungle.ca\/index.php?rest_route=\/wp\/v2\/posts\/2381\/revisions"}],"predecessor-version":[{"id":2874,"href":"https:\/\/tungle.ca\/index.php?rest_route=\/wp\/v2\/posts\/2381\/revisions\/2874"}],"wp:attachment":[{"href":"https:\/\/tungle.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2381"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tungle.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2381"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tungle.ca\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2381"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}