Skip to content

easterncoder/php-app-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PHP App Environment Builder via Docker Compose

Quickly setup your PHP Web Application environment using Docker Compose

  • Choose your PHP version (default latest PHP7) Tested on v5.6, v7.0, v7.1, v7.2, v7.3, and v7.4
  • Choose between Apache or Nginx as your web server
  • Choose your MySQL version (default latest)

Best for testing your PHP web application on a variety of environments.

Requirements

Installation

The following will build the latest versions of PHP7, Apache, and MySQL. Once up, you may access your web application at localhost:8080

  • wget https://github.com/easterncoder/php-app-docker/archive/master.zip
  • unzip master.zip
  • cd php-app-docker-master
  • export UID; docker-compose up --build

You may then look at:

  • localhost:8080/phpinfo.php
  • localhost:8080/adminer.php

File Paths

  • PHP Files (Put your PHP app here): app/web
  • MySQL Data (This is where MySQL will store its data): app/mysql

Default MySQL Credentials

  • HOST: mysql
  • USER: root
  • PASS: root

To start/stop an existing build

  • docker-compose start/stop

Other Build Options

Build options are specified by the following environment variables.

  • WEBSERVER
    • apache (default)
    • nginx
  • MYSQLVER
  • PHPVER
    • 7 (default: will build latest available version of PHP 7)
    • 7.4
    • 7.3
    • 7.2
    • 7.1
    • 7.0
    • 5.6

Examples:

  • Latest versions of PHP7, Nginx and MySQL
    export UID; export WEBSERVER=nginx; docker-compose up --build

  • PHP5.6, Apache (latest) and MySQL 5.6
    export UID; export WEBSERVER=apache; export MYSQLVER=5.6; docker-compose up --build

About

Quickly setup your PHP Web Application environment using Docker Compose

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages