This is just a small start point if you want to run laravel on docker without creating new Vagrant image.
- Install docker locally ( I've used docker for mac, but I guess it shoudl work any where you have docker installed ).
- PHP-fpm, nginx, mysql, and redis docker images, and don't worry the script will download them for you.
- You can use the
exec
file to execute the commands on docker, but make sure that you give it execute permissionchmod +x exec
. - To install the libraries using composer you execute
./exec docker_laravel composer.phar install
. - To require a new library using composer you execute a command like
./exec docker_laravel composer.phar require league/flysystem-sftp
. - To run any
artisan
command you can execute it like./exec docker_laravel artisan list
.
PS: the exec may not work as it should, esp if you have a lot of argument to send, and am still trying to figure the best way to rewrite the file.
- Thanks for Kyle Ferguson for his post as it was the starting point for me.
- Thanks for Dayle Rees for give me the idea of the exec shell script.
- Thanks for everyone who helped to create those nice docker images.
For windows users, make sure that you have enabled the shared volume from docker engine before you run the script
licensed under the MIT license.