Building swoft2 local development environment under Windows

Time:2021-9-17

1. Build a local virtual machine first, which will not be introduced here
2. Install and run docker (see article:https://learnku.com/articles/48123)
3. Build the docker container of swoft, and use the docker installation method provided on the official website:

docker run -p 18306:18306 --name swoft swoft/swoft 

4. Copy the swoft container code to the virtual machine user home directory

docker cp swoft:/var/www/swoft /home

5. Modify the HTTP server port in swoft / APP / bean.php to 80
6. Delete container

docker rm swoft

7. Reopen a container and map the folder

docker run -p 80:80 --name swoft --rm -d -v /home/swoft:/var/www/swoft swoft/swoft:latest

8. Enter the IP address in the browser, and the following effect appears, which proves that the installation is successful!

Building swoft2 local development environment under Windows

This work adoptsCC agreement, reprint must indicate the author and the link to this article