Skip to content
web development with PHP and Docker.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
nginx
php
README.md
docker-compose.yml
index.php

README.md

Pre-requisites

You must have Docker installed for this code to work! Check the Installation Guide if you haven't got it installed.

It contains a basic LEMP stack running with Docker, intented to be used for local web development.

Get started

Clone the project and run docker-compose

git clone https://github.com/jivoi/php-development-in-docker.git
cd php-development-in-docker
docker-compose up -d
docker-machine ip default
docker-compose -d down

Description

The different containers are described in docker-compose.yml.

There are 6 of them:

  • a container for Nginx
  • a container for PHP-FPM
  • a container for MySQL
  • a container for phpMyAdmin
  • a container to make MySQL data persistent
  • a container for the application code

All of them are using official images.

The current directory is mounted into the one served by Nginx on the container, so any update to the code is available without having to rebuild the container.

The MySQL data sits in its own directory mounted into its own container to make it persistent.

The application is available on the port 80 of the host machine.

phpMyAdmin is available on port 8080.

You can’t perform that action at this time.