How to create Docker image,Dockerfile of LAravel application from existing docker environment for Laravel
I have dockervel environment ,docker container for Laravel , and I really struggled to make it work on my machine.
The way I used the dockervel image is described here http://www.spiralout.eu/2015/12/dockervel-laravel-development.html
I have developed an application including Behat for BDD and PHPUnit testing in this environment and I have to make an image from it and say how to use It. I am confused how to create Dockerfile ?
any help is appreciated
2 Solutions collect form web for “How to create Docker image,Dockerfile of LAravel application from existing docker environment for Laravel”
First of all, dockervel is not a single image. It consists of sevelar images orchestrated together by docker-compose (see docker-compose.yml). And the reason for that is that you don’t need all the parts every time (eg. you don’t load nodejs when all you want is to work with artisan). Also you can change parts (eg. you can change MySQL with Postgres).
If you want to share your project, the easy way is to share the entire dockervel folder (please omit the node_modules folder, you can recreate it with
dcomposer install, as also the database folders).
If you realy want to make it a single dockerfile (not so good idea) you should combine each dockerfile into a single one and you will end up with a huge and not flexible container.
This is NOT the answer to your question but I had bit of struggle with dockervel as well and thought of simplifying the docker implementation for Laravel projects.
The result is https://github.com/purinda/docker-laravel
This gives you ability to easily communicate with Laravel CLI commands such as
artisan and running unit tests through
phpunit in a the docker environment using multi-container environment.