Categories
Docker

How To Build a Local Development Environment Using Docker

So let’s talk a little bit about development environments, shall we?

We developers are always trying to find the best solution when it comes to creating the best development environment, but that’s not always easy. Things are changing very fast nowadays and if you work on more than one project, things can get a little confusing.

About three years ago I thought I had the best solution for this problem using VirtualBox and Vagrant. I could start up a linux box in minutes and changes made in a project’s box would not affect other project’s environment. That was a nearly perfect solution when it worked. Most of the times things got out of hand when the projects got to big and complex and sometimes it was nearly impossible to recreate exacly the production environment using only one VM, and that’s when this solution failed.

Categories
Server Configuration

Connecting PHP to a MySQL inside a Docker container

If you ever had connection problems between PHP and a MySQL database in a Docker container, this article is for you.

I just went though this setting up this site. My linux box on AWS runs a couple of Node.js websites and I just wanted to install this WordPress site on the same server. I already had a Nginx server acting as a proxy and a MySQL server running on the server inside a Docker container so it would be very simple install php-fpm and configure another website on Nginx and use the same db server to kick off a WordPress site.