First, demand
PHP-msf is a PHP micro framework Carema360 service development, currently I have not actually used, but micro-services market, either in the framework of respected Spring
department, either go/node
, because I wanted to use PHP to engage in micro-services, on the way to search the next micro PHP services framework, found php-msf.
php-msf very little documentation, is a simple introduction about. But if familiar with the MVC PHP development framework, so long as skilled at API on it, the other nothing down.
As a micro-services framework, and Docker must be linked, and I think php-msf do very well in this area, but also has its own list of mirrors Docker to pull, eliminating the need to configure their own environmental problems.
Docker mirror list:
php-msf has been unable to open a document, you can go look at github:
For convenience, I had a look at the cloud document, at present few pictures I have not exactly boost:
Second, the deployment container
Installation deployed in Docker, the direct use of his Docker image:
-p 2201:22
: Ssh login in order to facilitate an open container port mapping, do not it does not matter, because you can use docker -it phpmsfdemo / bin / bash-p 81:8000
: The main container port is 8000 (phpmsf default listen port) mapped out, this port can be changed, according to the change of the port-v
: Mainly to facilitate the development time mapping file,/home/worker/data/www/
the default file directory of the web, according to the directory reform
docker run -dit --name phpmsfdemo -p 2201:22 -p 81:8000 -v /data/webroot/:/home/worker/data/
Mirror operation of the container php-msf, php operating environment
Third, the deployment code
After the container deployment is successful, the code can be deployed directly in the container.
Directly install the code using PHP-msf-Docker , which has a installer.php
, run this file, you can directly download directory and application framework.
For example, into the container, first of all git clone
php-msf-docer, for example, I clone to /home/worker/data
this folder.
git clone https://github.com/pinguo/php-msf-docker.git
Enter php-msf-docker
, run installer.php:
php installer.php start
Then choose the installation directory and application name, etc., to be followed successful configuration:
Default configuration is successful start, if you can not boot into the default directory manually start:
Manually boot into the installation directory can be, then you can run the server:
php server.php start
Fourth, run
After the start, through the dev mode is turned on, while the front of the monitor port can be visited.
Or a local area network:
Fifth, if found open when the port is occupied, you can modify the port to the config:
Download the file in the directory framework: config/http.php
: