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

  • How to handle differences in Dockerfile for dev/prod
  • How to fork child process in docker container
  • Connecting Docker to X11 via VNC fails
  • Docker - How to open a debug port for AEM
  • Local Java App not running on HBase/Phoenix Docker image
  • Docker Alpine nginx 403 Forbidden error for swagger-ui-builder
  • 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

  • Dockerfile: How to replace a placeholder in environment variable with build-arg's?
  • Docker: Installing libraries on centos image
  • Cayley docker isn't writing data
  • Docker: unable to execute the mount command inside an ubuntu 16.10 container [duplicate]
  • MySQL image ignores volume configuration of docker-compose.yml
  • Error: Postgres database import in docker container
  • 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.

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