Docker erected using PHP, Nginx, MySQL environment docker download on a free Mitutoyo cloud host application
clone git https://gitee.com/xupaul/docker_fast_init
configuration instructions
docker-compose.yml file adjustment
This file has a large number of files mount configuration, this will need to be adjusted, take a example.
version: "2"
services:
http:
image: nginx:1.12.1-alpine
volumes:
- ~/config/nginx/nginx.conf:/etc/nginx/nginx.conf:rw
ports: - "8080: 80"
Environment:
the TZ: "Asia / of Shanghai"
Networks:
tasker_net:
ipv4_address: "192.168.0.11"
Finally, in the examplevolumes
of the next line, is a host ofnginx.conf
the profile in the vessel and covering the mountnginx.conf
file,~/
file path is the directory after the clone git project directly replace.
If you also use a virtual machine, then you need ~/
to be replaced with docker
the path of the operating environment!
In ports
here, http services and in order not to conflict port 80 of the machine, and the sudo
port authority to apply less than 1024, and here I am to 8080 as the default. Other container port configuration also follow the above rules, in order to be able to be able to start up a command.
Each container is equipped with time zone.
This part of the network ip, in order to facilitate the configuration is manually assigned ip.
Nginx configuration
Configure the tcp communications, as well as routes between php php-fpm rewrite. Configured with a static resource cache.
MySQL Configuration
Additional equipment general query log, easy to debug the program.
PHP configuration
php:
image: paulxu/php:5.6-fpm-jessis-pdo-xdebug-mysqli-gd-mb-zip-2
volumes:
- ~/config/php/cli/php.ini:/usr/local/etc/php/php.ini/:rw
ports:
- "9000"
environment:
PHP_IDE_CONFIG: "serverName=bs"
Mirror building
php mirror
Can be pulled through the following commands:
docker pull paulxu / php: 5.6- fpm-jessis-pdo-xdebug-mysqli-gd-mb-zip-2
or to a ~/build/php5.6
self-packing follows:
docker build -t paulxu / php: 5.6 -fpm-jessis-pdo-xdebug-mysqli-gd-mb-zip-2 -f dockerfile.
If a custom tag name, together with the need to adjust the docker-compose.yml
start up
-
Configuring gitee download
-
According to their environment to adjust the configuration
- start up
Start command
The current thread running, to stop time, typeCtrl+C
docker-comose -f ./docker-compose.yaml up
Background process
docker-comose -f ./docker-compose.yaml up -d
Stop docker
docker-comose -f ./docker-compose.yaml down