Public | Automated Build

Last pushed: 3 years ago
Short Description
Nginx + PHP + MySQL All-In-One Docker
Full Description

Nginx + PHP + MySQL All-In-One Docker

Install Docker

CentOS 6 quick install

$ sudo rpm -ivh
$ sudo yum install docker-io device-mapper-event-libs git
$ sudo /etc/init.d/docker start

CentOS 7 quick install

$ sudo yum install docker device-mapper-event-libs git
$ sudo systemctl start docker

Ubuntu 14.04 quick install

# curl -sSL | sh

get image

build manually

$ git clone
$ cd docker
$ sudo docker build --no-cache -t="amwso/docker" .

pull directly

$ sudo docker pull amwso/docker


Run instance with random mysql root password, you can find the password in /data/var/log/mysql-root-pw.txt.

$ sudo docker run -h localhost -p=80:80 --name myapp -v /data/myapp:/data -d amwso/docker

Environmen Variables

MYSQL_PASSWORD=mySecret - set mysql root password manually

DOCKER_DISABLE_PMA=yes - disable PHPMyAdmin, PHPMyAdmin login path http://localhost/pma

DOCKER_INSTALL_WEBSHELL=mySecret - enable webshell (disabled by default), mySecret is your shell login password, webshell login path is http://localhost/shell.php

DOCKER_INSTALL_WP=yes - install Wordpress automatically

DOCKER_WP_ADMIN - set wordpress admin user name, if not set, defaults to admin

DOCKER_WP_PASSWORD - set wordpress password, if not set, defaults to password

Service & Operating

enter an existing instance

$ sudo docker exec -ti myapp /bin/bash

reload a service

$ sudo docker exec myapp /bin/bash -c "supervisorctl kill HUP nginx"

reset mysql root password, write new password in log/mysql-root-pw.txt

$ sudo docker exec myapp /root/sbin/tools/

directory & path

/data/conf - all config files
/data/var/log - all log files
/data//mysql - mysql data
/data/tmp - temp and php session
/data/var - variables
/data/www - nginx web root
http://localhost/nginx_status - nginx status page
http://localhost/php_status - php status page - PHPMyAdmin - web shell (disabled by default)
Docker Pull Command
Source Repository