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

  • How to import .bacpac into docker Sqlserver?
  • Docker installation issues on CentOS 7.1
  • Mysqladmin in mysql docker?
  • Can I Log my docker containers to Fluentd and **stdout** at the same time?
  • Docker set read timeout for push
  • How to isolate builds in jenkins using docker
  • 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

  • Single machine Swarm in Docker 1.12
  • Trying docker in docker getting TCP connection refused error
  • how to pass command line arguments to a python script running in docker
  • Using the postgres image in a test
  • Not able to access tomcat application on Docker VM with host(windows) IP while using docker toolbox
  • How to change docker container's source code without restarting it?
  • 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

    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.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.