Laravel & Docker Development Setup | An Updated Guide

Laravel & Docker Development Setup | An Updated Guide

Earlier in the year, I was on the hunt for a simple and complete guide to get setup with a custom Docker environment in a Laravel setting. Laravel & Docker Development Setup | An Updated Guide. Initial Server Setup Guide for Ubuntu 20.04. Docker installed on your server.

Earlier in the year, I was on the hunt for a simple and complete guide to get setup with Laravel in a Dockerised environment. Thankfully, I came across an amazing guide published by  Shane Osbourne way back at the start of 2017. I used this guide and loved every moment — however, I soon realised things have changed since then and that there was some missing pieces for a complete development guide.

I’m hoping to shed some more light on what Laravel development looks like in a Dockerised environment and show you how to incorporate some extra utility containers to round off your local development.

Reviewing the Alternatives

Before I get started, it’s good to acknowledge that there are out of the box options. At the end of 2020,  Taylor Otwell released a package by the name of  Laravel Sail that helps you get right into development without having to do any configuring of Docker.

This is a great tool and definitely one you want to check out if you’re in a pinch or just need a default docker environment. You can find the documentation  here.

_Note: _ If you do want to use Laravel Sail, you’ll need to make sure you have a Laravel 8+ project and if you’re on Windows you’ll have to use WSL 2.

So, what are we building?

We’re going to create a Docker environment that will allow you to easily swap out your versions, and require you to only have Docker installed locally. None of those nasty symlink issues with your PHP or MySQL versions.

Here’s a list of the services we’ll be creating in our Docker environment —

  • PHP-FPM Process Manager (Application layer — PHP 7 or PHP 8+)
  • Nginx (Web layer) — Refer to the end of the article for Apache
  • MySQL (Database layer)
  • Mailhog (Mailing layer)
  • PhpMyAdmin (Database management)

php nginx docker laravel devops

What is Geek Coin

What is GeekCash, Geek Token

Best Visual Studio Code Themes of 2021

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

How To Set Up Laravel App on Docker, With NGINX and MySQL

Deploying Your Laravel App on Docker, With NGINX and MySQL ... The original post was also uploaded here: Laravel Application on Docker.

Ever Wondered Why We Use Containers In DevOps?

At some point we've all said the words, "But it works on my machine." It usually happens during testing or when you're trying to get a new project set up. Sometimes it happens when you pull down changes from an updated branch.

Php how to delete multiple rows through checkbox using ajax in laravel

In this article i will let you know to delete multiple rows through checkbox using ajax in laravel and before delete we will give a confirmation message.

Tutorial Laravel 6 with Docker and Docker-Compose

In this tutorial, we'll learn how we can use Docker and Compose to develop and run Laravel 6 applications locally.

How to Install Laravel PHP Framework with Nginx on Ubuntu 20.04

Laravel is the most popular, free, and open-source PHP framework in the world, known for its expressive and elegant syntax. Laravel is accessible, powerful, and offers some of the best web development tools required for large, robust, and modern applications. In this article, you will learn how to install the Laravel PHP Framework on Ubuntu 20.04 server running on the Nginx web server.