Docker Laravel实战

1
2
3
4
5
composer create-project --prefer-dist laravel/laravel blog
docker pull laraedit/laraedit
docker run -d --name laravel -p 8082:80 -p 3307:3306 -v {blog对应的目录}:/var/www/html/app laraedit/laraedit
docker exec -it laravel /bin/bash

进入docker container后可以执行这个命令链接mysql

1
mysql -u homestead -h 192.168.99.100 -P 3307 -p # 預設帳號為 homestead 密碼為 secret