My Local Development Environment. then and now and What I learn from it till now.

My requirement for the local environment is to be set up a WordPress/Php sites so I needed PHP, MySQL, Apache/Nginx services.

Ok. In one line Im using myown setupwith docker-compose, customized the10ups wp-local-docker environment with the support of multiple sites setup.

I was usingeasyengine on my ubuntu system and it was easy to set up with few commands only.

But I kinda always messing around with my machine and end up being formatting my system sometimes just because I wanted to try diff OS so in all of this times Ive to backup my all the sites data from my user to diff dir and had to dump all the databases and again set up everything and put all the things back to gather. Always make me sick.

In meantime, I heard about theVVV/Vagrant and tried that but never liked that just because of the performance and my machine get too slow, and Im using chrome so nahh never went with that. But yeah on few projects I had to use this because of the requirements of the same system environment.

Ok and then I heard aboutDockerand try to use that and seem like this is what I wanted for long. ( I took some help from my friends who are good with server-side things and learn what it is. ) I can say its a standalone environment ( kinda like VVV but better ) now I can able to setup everything wherever I want with all shared required directory of easyengine. I build myfirst imagewith easyengine setup and then I was using the share volumes and used it for a while. In doing so I got to know more about the Nginx, MySQLconfigurationswhere I needed the files to be located.

docker run -it name=ee -p 80:80 -p 22222:22222 -p 3306:3306 -p 443:443 -v ./www:/var/www -v ./lib/mysql:/var/lib/mysql -v ./lib/ee:/var/lib/ee -v ./etc/nginx:/etc/nginx -v ./etc/hosts:/etc/hosts -v ./etc/ee:/etc/ee rahulprajapati/ee-ubuntu

So, at first I started with this and this solves my problem now when I format my machine or change my system all I need is this dir, setup docker and run the command, And I got all my sites with the same data. I dont need to backup any sql dump and reimport it, or take a backup of my sites I can just keep my working dir where everI want.

And this helps me when I moved from Linuxto MacI just needed my local environmentdir where I put all the things. Thats how I went into Docker.

But that wasnt it, it never will be we got docker-composer and learn about it also learn that we should use the different container for each service which is good for performance and we can share services between other containers/services.

Then I tried some of the opensource development environment of WordPress environments and see what and how they are using it. I came up with these two environment setups.

And I liked to go with the second one, 10ups wp-local-docker and used it for a while. Because of the following reasons ( this might be silly reasons but was checking my requirements ).

  1. I can able to access WordPress root dir easily.
  2. Easily run the commands in containers using docker-compose. Helps in WP-CLI commands mostly.
  3. It has mailcatcher, memcached, elasticsearchservices.

Now, this setup is for the single site so I always have to set up this for each new projects and then I missed easyengine. And now I thought that I can make it happen just needed to do some tweaks and tricks in my setup. So, I went around forNginx config file requirementsand how to handle multiple site domains with diff sites.

And finally got it working fine, now Im using my own customized docker-compose setup on my Mac.

About me.

Hey there, Im Rahul, Sr. WordPress Engineer.

I enjoy working with web technology. And Im a fan of Marvel and DC both

And this is my first blog post. Never thought will write one.

Im not a good writer/blogger so not sure what Ill be writing on my blog but I liketechnical stuff so it will be more related to that only.