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.

  • How to add variable to docker daemon in CentOS?
  • Docker on RHEL 7 in AWS can’t pull images
  • PHP websie, mysql, rabbitMQ on Docker
  • Chaning tcp_keepalive_* inside a docker container
  • docker compose and jenkins
  • Version increment for docker images
  • Python webscraper using selenium works normally but not when headless
  • Creating a bootstrap Dockerfile that automatically exposes files to the host operating system
  • Jenkins docker plugin and linked slaves
  • Creating docker named volume pointing to folder on host
  • Why is PyCharm killing my subprocess.Popen?
  • How to cusomize docker0 in Docker for different IP range?
  • 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.