• Home
  • Get Noticed 2017
  • PHP
  • Quick Tips
  • Contact
  • About me

Bartosz Sosna Blog

Bartosz Sosna Blog

PHP BLOG

PHP development environment with Docker
Docker, Get Noticed 2017, MySQL, Nginx, PHP

PHP development environment with Docker

Today I will tell you, how can you create development environment with Docker.

First, check Docker installation. Type in console:

docker version

You should see actual Docker version. If you don’t see it, then you’ll first install Docker:
https://docs.docker.com/engine/getstarted/step_one/#step-2-install-docker

If your installation is positively verified, then we will start.

In my project “Image optimizer API” I will use PHP7, MySQL and Nginx.

All this can we find here:
https://github.com/hamptonpaulk/php7-dockerized

We can install all in 3 easy steps:
1. Clone repository:

git clone https://github.com/hamptonpaulk/php7-dockerized.git

2. Adjust “docker-compose.yml” file. Change default MySQL password:

MYSQL_ROOT_PASSWORD: yourNewPassword

3. Run command:

docker-compose up -d

Be patient, first time Docker must download all required images.

When the script finishes the operation, then you’ll check result in browser:
http://localhost/

You should see phpinfo result:

For MySQL connection, I use “Sequel Pro“. You can use an alternative program or install phpMyAdmin.

Congratulations! That’s all. You can start coding. Your code should be in “www/” folder.

Enjoy!

If you have a problem with MySql connection check this post:
http://bsosna.com/2017/04/23/how-to-connect-php-container-with-mysql-container/

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)
  • Click to share on Google+ (Opens in new window)

Related

Written by Bartosz Sosna in March 12, 2017 / 1819 Views
Tags | Docker, mysql, nginx, php
AUTHOR
Bartosz Sosna

I'm Web and App developer. I love gadgets and new technologies. I'm also productivity freak.

You Might Also Like

Phinx – PHP database migration

April 30, 2017

How to connect PHP container with MySql container

April 23, 2017
how to work faster with phpstorm

How to work faster with PhpStorm

March 26, 2017

No Comment

Please Post Your Comments & Reviews
Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Previous Post
Next Post

Serach

Newsletter

Latest Posts

  • API, Get Noticed 2017, PHP“Image Optimizer API” is ready“Get Notice 2017” contest is over My project “Image Optimizer…May 21, 2017
  • Get Noticed 2017, Quick Tips, zshZ shell (zsh) – better bashWhy zsh is better? I use console from years and…May 18, 2017
  • API, Get Noticed 2017, Quick TipsPostman – powerful tool to work with APIPostman – powerful tool to work with API I’m creating…May 7, 2017
  • Capistrano, Get Noticed 2017, PHP, Quick TipsHow to add tasks to capistranoHow to add tasks to Capistrano I wrote in post…May 5, 2017
  • Get Noticed 2017, MySQL, PHP, Quick TipsPhinx – PHP database migrationWhat is “database migration” I meet migrations first time in…April 30, 2017

STAY UPDATED

About Me

About Me

Web and App developer.

I'm Web and App developer. I love gadgets and new technologies. I'm also productivity freak.

About me (de)

Latest Posts

  • API, Get Noticed 2017, PHP“Image Optimizer API” is ready“Get Notice 2017” contest is over My project “Image Optimizer…May 21, 2017
  • Get Noticed 2017, Quick Tips, zshZ shell (zsh) – better bashWhy zsh is better? I use console from years and…May 18, 2017
  • API, Get Noticed 2017, Quick TipsPostman – powerful tool to work with APIPostman – powerful tool to work with API I’m creating…May 7, 2017
  • Capistrano, Get Noticed 2017, PHP, Quick TipsHow to add tasks to capistranoHow to add tasks to Capistrano I wrote in post…May 5, 2017
  • Get Noticed 2017, MySQL, PHP, Quick TipsPhinx – PHP database migrationWhat is “database migration” I meet migrations first time in…April 30, 2017
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy

FOLLOW ME ON TWITTER

  • RT @DamianNaprawa: Festiwal Docker & Kubernetes - DZIEŃ 3 BARTOSZ SOSNA @brtsos Palec wskazujący skierowany w prawo Konfiguracja środowi…33 days ago
  • W końcu MacBook Pro bez bezużytczego touch bara? https://t.co/5tweGBUxP245 days ago
Bartosz Sosna Blog

Copyright © Bartosz Sosna