<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Prappo</title>
    <description>The latest articles on DEV Community by Prappo (@prappo).</description>
    <link>https://dev.to/prappo</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F595088%2F2ea958b1-e104-4e30-bdd5-b7670dd326e2.jpg</url>
      <title>DEV Community: Prappo</title>
      <link>https://dev.to/prappo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/prappo"/>
    <language>en</language>
    <item>
      <title>Setting up your WordPress development environment in Docker</title>
      <dc:creator>Prappo</dc:creator>
      <pubDate>Thu, 14 Oct 2021 11:55:10 +0000</pubDate>
      <link>https://dev.to/prappo/setting-up-your-wordpress-development-environment-in-docker-4oc9</link>
      <guid>https://dev.to/prappo/setting-up-your-wordpress-development-environment-in-docker-4oc9</guid>
      <description>&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Assuming you already know how to use docker and basics of WordPress theme and plugin developments. &lt;br&gt;
If you already don't know much you can check the following links.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://docs.docker.com/get-started/" rel="noopener noreferrer"&gt;Docker&lt;/a&gt; and &lt;a href="https://docs.docker.com/compose/install/" rel="noopener noreferrer"&gt;Docker Compose&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.wordpress.org/plugins/intro/" rel="noopener noreferrer"&gt;Introduction to Plugin Development&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://codex.wordpress.org/Theme_Development" rel="noopener noreferrer"&gt;Theme Development&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Goals
&lt;/h2&gt;

&lt;p&gt;This is good practice not to touch WordPress core. All of our works will based on &lt;strong&gt;themes&lt;/strong&gt; and &lt;strong&gt;plugins&lt;/strong&gt; folders. So we will make a system where &lt;strong&gt;themes&lt;/strong&gt; and &lt;strong&gt;plugins&lt;/strong&gt; folders are accessible from out side of container so that if we change the plugin or theme code then the effect will be applied immediately on development site.&lt;/p&gt;
&lt;h2&gt;
  
  
  Steps
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Let's create &lt;code&gt;docker-compose.yml&lt;/code&gt; file in our development folder.&lt;/li&gt;
&lt;li&gt;Define the services.&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;docker-compose up&lt;/code&gt; command to up and running our development environment.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  Creating docker-compose.yml and defining services
&lt;/h3&gt;

&lt;p&gt;For our development process we need three services container&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Database ( MySQL )&lt;/li&gt;
&lt;li&gt;WordPress&lt;/li&gt;
&lt;li&gt;phpmyadmin ( database browser )&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;phpmyadmin&lt;/code&gt; is optional we are using this if we need to browse the data for development purpose. You can skip it if you want.&lt;/p&gt;

&lt;p&gt;Let's see how we can define these services. &lt;br&gt;
Edit the `docker-compose.yml' file and follow the steps.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Define the docker compose version at the very top like this &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;code&gt;version: "3.3"&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Define database container&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz6thzhzpg6yd239otcel.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz6thzhzpg6yd239otcel.png" alt="image" width="800" height="659"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Define WordPress container&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmhlx7g1kak4g3ty09q6u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmhlx7g1kak4g3ty09q6u.png" alt="image" width="800" height="571"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Define Phpmyadmin container&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuybg275m344mggcfnptx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuybg275m344mggcfnptx.png" alt="image" width="800" height="745"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Full docker-compose.yml code
&lt;/h2&gt;


&lt;div class="ltag_gist-liquid-tag"&gt;
  
&lt;/div&gt;


</description>
      <category>wordpress</category>
      <category>docker</category>
    </item>
  </channel>
</rss>
