Ok, time for some action!

I’ll start the project by setting up the environment. As mentioned in the previous post, I want to use Docker to simplify configuration for everyone who wanted to create this project with me 😉

I’m not a docker expert. In fact, a basic configuration for this project took me about 2 days! I could not find ready to use configuration so I had to create it myself using 2 or 3 different configurations.

But finally I made it, and I proudly present it to you! It is very simple and you might be surprised what took me so long 😉

Docker

First of all, you have to install docker. Choose your platform and follow the steps described in official docker manual. Please note, that you’ll need `docker-compose` too.

If you install it correctly then it is almost everything you have to install on your computer to follow my project! Almost, because the code will be hosted on the local environment and mounted to docker. I choose this way to simplify development, it’s (perhaps) easier to write code in IDE using local directory than using dockerized one. But I’m not sure, so if you want to check it – just try and let me know 😉

Composer

To develop the application on local you have to have `composer` to install Symfony framework itself and its vendors. You’ll find installation instruction here.

IDE

And you’ll need an IDE of course. I’m using PhpStorm for over 2.5 years and its, in my opinion, one of the best things that happened to PHP! Its fast, comfortable and very powerful. And expensive… But don’t worry, they have free 30 days trial, so you could try it and decide if you want to use it or maybe you’ll change the editor. The project will be quite simple, so a simpler IDE or even notepad, like Atom or Sublime, will be ok as well. PhpStorm can be found here.

Launching docker

I’ve prepared repository on GitHub with docker configuration, you can find it here. You have to clone it to some directory on your computer by calling `git clone [email protected]:zelazowy/docker-nginx-php7.git`. It’s very lightweight, so it’ll take only seconds.

Next step is to specify domain used in the project. I’m using `evernote.local` domain, but you could change it if you want 🙂
You have to edit `/etc/hosts` file and add just one line `127.0.0.1 evernote.local`. And that’s it.

If everything goes ok you’ll be able to run docker by calling `docker-compose up` on main repository’s directory (where `docker-compose.yml` file is located).

It’s alive!

To validate the environment go to your browser and go to this url: `http://evernote.local:8686/app_dev.php` (I’m using port `8686` in docker so you have to specify it in the url to forward traffic from local machine to docker)

You should see something like this:
Zrzut ekranu 2016-08-02 o 23.02.09

If yes, then it’s all set up correctly and you’re ready for next step. Which will be described in the next post 🙂
If no – let me know, I’ll be more than happy to help you, so don’t hesitate.

Don’t forget to check out other PHPhyts!