Category: docker

How to configure PHPStorm 2017.1 to work with native Docker for mac

Today PHPStorm released the new version of 2017, with the number 2017.1

There are a lot of changes and updates, the main one which I want to talk about today is the fact that from now on no need to use socat as mentioned in my older post to talk to Docker on mac, now you can talk to it directly using the unix socket like this

Docker settings
Docker settings

 

Information! I Do advice you to read the old article as I go with more details about the topic
Filed under: Code, docker, PHP

How to test and auto deploy your laravel code from Gitlab

Few days ago, I was playing with the new Laravel 5.4 and Gitlab CI, and got to the point where I wanted the CI to test my code once I push it.

Using google lead me to this post on Laracasts, and it was the starting point for me, there you can get important files .gitlab-ci.yml and .gitlab-ci.sh  , basically the first one will define the stages for the testing and the second one will build the environment for your test.

So lets look at a short version of .gitlab-ci.yml

Continue reading

Filed under: Business, Code, docker, Laravel, Linux, MySQL, PHP

Why to use Vagrant or Docker for development?

Few years ago, I was introduced to Vagrant and for me it was the most elegant tools I ever used, at the end it ended up the most annoying argument I ever hear all the time ” It works on my computer “, at that my team at the company used to use MAMP (yes they all use MAC so we are all have the same OS but different versions), and when I did introduced Vagrant they really liked the idea, especially that it was so easy to have your environment up and running in just few hours (based on your internet connection and what tools you will have to download).

Now things got more better, so I created a Vagrant file which we all used and share, it was based on Vaprobash and everything went so simple after that, we never heard that annoying phrase anymore, we all now have the same environment (despite the fact that I always update & upgrade my installed image, and I cant guarantee that everyone else does that), and the benefit was way more than what we though, now if we are working for a Node.js project, you can just grab a Vagrant file or image for it, if we are working on PHP the choices are open and we have no limit.

Continue reading

Filed under: Code, docker, Other, PHP

Docker compose wait don’t run it now

One of the main problem you will face when you work with Docker is that you are not 100% sure that the service on the ImageX is ready for you to use it or even for ImageY to communicate with it.

For example, lets say that you have the ImageX which run MySQL/MariaDB (or any other DB), and ImageY which run PHP, no matter how you try you cant be sure that ImageX is ready to accept connections from ImageY and CRUD some data from it, so Docker docs stated that you should find some solution for that, and they do provide some simple instruction for it on Controlling startup order in Compose.

Continue reading

Filed under: docker, Linux, MySQL, PHP

The myth about Docker depends_on and links

I have been reading lately (again) a lot of articles which try to explain to the developers how to use Docker for development, now they are all good (in general), each try to make simple and easy for you to move and use docker, and everyone advice you to use depends_on and links (but remember links is a legacy compose item so with Docker 1.13 you should use depends_on ).

both some how works the same, except that depends_on will give you the ability to define the order which your images should start.

Continue reading

Filed under: Code, docker, Linux, MySQL, Nginx, PHP