惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Martin Fowler
Martin Fowler
Jina AI
Jina AI
J
Java Code Geeks
Microsoft Security Blog
Microsoft Security Blog
Recent Announcements
Recent Announcements
I
InfoQ
L
LangChain Blog
The Cloudflare Blog
IT之家
IT之家
博客园 - 叶小钗
Apple Machine Learning Research
Apple Machine Learning Research
B
Blog
A
About on SuperTechFans
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Last Week in AI
Last Week in AI
Blog — PlanetScale
Blog — PlanetScale
罗磊的独立博客
云风的 BLOG
云风的 BLOG
Microsoft Azure Blog
Microsoft Azure Blog
Engineering at Meta
Engineering at Meta
F
Fortinet All Blogs
博客园 - 聂微东
美团技术团队
博客园_首页

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Production Mindset - Laravel with Docker Compose
yebor974 · 2026-05-06 · via DEV Community

Introduction

In the previous article, I showed how to build a production-ready Docker image for Laravel & Filament.

But in real-world applications, a single container is never enough.

Running a production application means dealing with multiple concerns:

  • web server
  • PHP runtime
  • database
  • cache
  • background workers
  • scheduled jobs

And this is where things usually start to get messy.

The problem with "simple" setups

Most Docker Compose examples look like this:

  • one container
  • maybe a database
  • everything else mixed together

It works.

Until it doesn’t.

From my experience, this approach quickly leads to:

  • poor observability
  • difficult debugging
  • no real scaling strategy
  • fragile deployments

A simple rule I follow

Over time, I ended up following one principle:

👉 one container = one responsibility

It sounds simple, but it completely changes how you design your architecture.

A production-oriented architecture

Instead of one container doing everything, I split responsibilities:

  • app → PHP-FPM runtime
  • web → reverse proxy (Nginx)
  • db → PostgreSQL
  • redis → cache & queues
  • horizon → queue workers
  • scheduler → scheduled jobs

Each service is isolated.

Each service can scale independently.

Each service can fail independently.

👉 This is what makes the system predictable.

A common trap: the "public volume"

One mistake I’ve seen (and made) multiple times is how static assets are handled.

A typical setup uses:

public:/var/www/app/public

Looks fine.

But in practice:

  • old assets can persist between deployments
  • new builds may not be reflected
  • deployments become inconsistent

👉 This kind of issue is subtle… and painful in production.

Another key point: bootstrap vs runtime

In many setups, migrations and initialization tasks run inside the main container.

I prefer separating concerns:

  • runtime containers → long-running processes
  • bootstrap → one-time tasks (migrations, setup)

👉 In real production systems, this is often handled in CI/CD pipelines instead.

Why this matters

This kind of architecture gives you:

  • better isolation
  • clearer debugging
  • safer deployments
  • real scalability

It’s not the simplest setup.

But it’s much closer to what you actually need in production.

Going further

In this article, I intentionally kept things focused on concepts and architecture.

👉 I cover the full Docker Compose setup (with real configuration, volumes, healthchecks, and production patterns)

https://filamentmastery.com/articles/production-ready-docker-compose-for-laravel-filament/

Series

This article is part of a series on production-ready Laravel & Filament setups:

  • Docker image (multi-stage build)
  • Docker Compose architecture
  • CI/CD pipelines
  • deployment strategies

I’ll be covering each part progressively.


If you’ve already built similar setups, I’d be curious to hear how you structure your containers in production.