Create a development environment for Laravel in Docker

I have a custom Laravel installation on my Ubuntu machine. As per Laravel’s instructions however, I didn’t use Homestead to spin up my app. Instead I installed the app using composer on my machine and then installed the dependencies and libraries as per the requirement.

Now I want to use another machine for development. How’s it possible using Docker to package a replica of my machine’s environment to create a container to be used on the other machine. I am new to Docker and haven’t used it before for whatsoever reasons.

  • Looking for a convenient way to start and stop applications with docker-compose
  • Running a Docker container that accept traffic from the host
  • Close Docker expose port from parent file
  • how to add localhost port to docker container
  • save installations at Docker
  • Can't delete pods in pending state?
  • Files deleted inside docker container not freeing space
  • How do I get rid of the HWaddr that docker0 is using?
  • two applications used in docker swarm
  • Elasticsearch\Common\Exceptions\BadRequest400Exception No handler found for uri [/indexsearch] and method [POST]
  • Docker (rails) - Changes in server side code, require restart app
  • How to push only specific change in docker image
  • 2 Solutions collect form web for “Create a development environment for Laravel in Docker”

    Have you considered using Laravel Valet? It’s a lot more light weight than Docker and Homestead and can spin up your projects almost instantaneously.

    If you wish to persist with Docker then Laradock has probably figured out most of what you wish to use.

    I created a barebones Docker Compose repo that can be used for Laravel or as a LAMP Server and it comes with:

    • Apache
    • PHP
    • MySQL
    • Composer
    • PHPMyAdmin

    Most of the ones I came across are pretty bloated with stuff that I didn’t need.

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