Skip to content

Latest commit

 

History

History
56 lines (46 loc) · 942 Bytes

README.md

File metadata and controls

56 lines (46 loc) · 942 Bytes

Run a PHP application in a docker container

Includes linked containers for PHP, Nginx and Mysql.

Install

Docker

Directory

Go to the directory where this repository was cloned.

E.g:

$ cd /var/www/docker-php

Build Container

$ docker-compose build

Start Container

$ docker-compose up [-d]

-d to run in detached mode

Run bash in container

$ docker exec -it containername_php_1 /bin/bash

Run composer

$ cd app
$ php composer.phar update

Run phpunit

$ ./bin/phpunit [--debug]

HTTP access

http://localhost:8080/

Mysql access

127.0.0.1:32776
root:root

Packages

  • php:7.2-fpm. To change PHP version, update docker/php/Dockerfile.
  • nginx:stable. To change Nginx version, update docker/nginx/Dockerfile.
  • mysql:5.7. To change Mysql version, update docker-compose.yml