Skip to content
/ laravel-in-docker Public template

My perfect production-ready Laravel 11 with Docker setup (MySQL, Queue, Scheduler, Web)

Notifications You must be signed in to change notification settings

Sammyjo20/laravel-in-docker

Repository files navigation

Laravel in Docker

This is a personal project to try and achieve a perfect, production ready Laravel starter kit that works with Docker. The goal is that we can just build a Docker Compose script which creates various services for a full Laravel app.

Installation

  1. Run docker build -t laravel-in-docker .
  2. Run cp .env.example .env
  3. Generate a random password in the DB_PASSWORD env variable
  4. Run docker compose up -d

Deployments

  1. Run git pull
  2. Run docker build -t laravel-in-docker .
  3. Run docker compose up -d

Requirements

  • NGINX Proxy Pointing to PHP-FPM
  • Scheduler
  • Laravel Queue
  • Ability to set the max upload/max timeout

Debugging SSL Issues

This is likely because the TRUSTED_PROXIES env variable. This is usually set to 192.168.0.0/16 however this could be set to something different. Your mileage may vary.

Caddy

This docker-compose script contains a Caddy configuration. You can simply comment it out to enable it and configure your Caddyfile with your domain. It's also recommended to disable any outbound ports for the web as Caddy can handle all of this and the only ports you need to open will be 80 and 443.

About

My perfect production-ready Laravel 11 with Docker setup (MySQL, Queue, Scheduler, Web)

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages