This document provides a comprehensive introduction to the lemp-docker repository, a Docker-based solution for deploying LNMP (Linux, Nginx, MariaDB, PHP-FPM) stack applications. The document covers the image ecosystem, variant matrix, high-level architecture, and core concepts needed to understand and use these Docker images effectively.
For specific configuration details and environment variables, see Configuration Reference. For container internals and service topology, see Container Architecture. For build system details, see Build System.
Sources: README.md1-13
The repository provides Docker images for an LNMP stack, commonly referred to as LEMP:
| Component | Description | Role |
|---|---|---|
| Linux | Alpine Linux base | Operating system foundation |
| Nginx | Web server | HTTP request handling, static file serving |
| MariaDB | Database server | Data persistence and management |
| PHP-FPM | PHP FastCGI Process Manager | Dynamic content execution |
The acronym "LEMP" uses "E" for "Engine-X" (Nginx pronunciation). Both terms refer to the same stack. The images are published under both namespaces: fbraz3/lnmp and fbraz3/lemp.
Sources: README.md5-7
The LNMP images are built on a modular ecosystem of base images from the fbraz3 namespace, providing a layered architecture for maintainability and feature reuse.
Sources: README.md11-13 README.md231-248
From the upstream base images, all LNMP images inherit:
| Feature | Source Image | Description |
|---|---|---|
| Email sending | php-base-docker | SMTP configuration for PHP mail() function |
| PHP directive management | php-fpm-docker | Environment variable-based PHP configuration |
| Cronjob support | php-fpm-docker | Cron scheduling via /cronfile mount |
| Nginx + PHP-FPM integration | php-nginx | Optimized web server and application runtime |
Sources: README.md231-248
The repository produces a matrix of images across three dimensions: PHP version, flavor, and environment.
The build system supports 11 PHP versions spanning from legacy to modern releases:
| Version | Support Status | Notes |
|---|---|---|
| PHP 5.6 | Legacy | End of life |
| PHP 7.0 - 7.4 | Legacy | End of life |
| PHP 8.0 - 8.4 | Active | PHP 8.4 is latest |
Sources: .github/workflows/base-images.yml14-36
| Flavor | Description | Use Case |
|---|---|---|
| Vanilla | Base LNMP stack with no framework | General-purpose PHP applications |
| Phalcon | Includes Phalcon PHP framework | Applications using Phalcon framework |
Sources: README.md80-86
The critical architectural distinction is between development and production variants:
| Aspect | Development (-dev) | Production (no suffix) |
|---|---|---|
| phpMyAdmin | ✓ Accessible at /pma/ | ✗ Not installed |
| Database Port | ✓ Exposed on 3306 | ✗ Internal only |
| Root Password | ✗ Empty (no password) | ✓ Required via MYSQL_ROOT_PASSWORD |
| Security | ✗ Minimal (convenience first) | ✓ Hardened (security first) |
| Custom SQL | ✗ Not supported | ✓ Executed from /sql-scripts |
| App Provisioning | ✗ Manual setup | ✓ Automated via env vars |
Sources: README.md34-57 README.md187-202
The tagging scheme follows this pattern:
fbraz3/lnmp:{php_version}[-{flavor}][-{environment}]
| Tag Pattern | Example | Description |
|---|---|---|
{version} | 8.4, 8.3, 7.4 | Production vanilla |
{version}-dev | 8.4-dev, 8.3-dev | Development vanilla |
{version}-phalcon | 8.4-phalcon | Production Phalcon |
{version}-phalcon-dev | 8.4-phalcon-dev | Development Phalcon |
latest | latest | PHP 8.4 production vanilla |
latest-dev | latest-dev | PHP 8.4 development vanilla |
latest-phalcon | latest-phalcon | PHP 8.4 production Phalcon |
latest-phalcon-dev | latest-phalcon-dev | PHP 8.4 development Phalcon |
All tags are available under both fbraz3/lnmp and fbraz3/lemp namespaces.
Sources: README.md58-79 .github/workflows/base-images.yml206-227
All images are built as multi-architecture manifests supporting:
linux/amd64 (x86-64)linux/arm64 (ARM 64-bit, including Apple Silicon)Docker automatically selects the appropriate architecture for the host system.
Sources: README.md76-78 .github/workflows/base-images.yml42-46 .github/workflows/base-images.yml198
The images package a complete LNMP stack within a single container, orchestrated by process supervision.
Sources: README.md88-139 High-Level Diagram 3
Sources: High-Level Diagram 3
The repository uses GitHub Actions to automate image building, testing, and publication.
The matrix produces 44 images per workflow (vanilla and Phalcon each):
Sources: .github/workflows/base-images.yml8-36 High-Level Diagram 1, High-Level Diagram 5
Each build includes automated testing before publication:
Development Image Tests (.github/workflows/base-images.yml63-79):
grep mariadbd)mysqladmin ping)telnet 127.0.0.1 3306)curl http://127.0.0.1/)curl http://127.0.0.1/pma/)monit summary)Production Image Tests (.github/workflows/base-images.yml96-116):
mysqladmin -u root -p...)! curl -f /pma/)USE test_app_db)Sources: .github/workflows/base-images.yml63-116 High-Level Diagram 5
Production images support application provisioning via environment variables:
| Variable | Purpose | Example |
|---|---|---|
MYSQL_ROOT_PASSWORD | Required root password | securePass123! |
MYSQL_APP_DATABASE | Auto-create application database | my_app |
MYSQL_APP_USER | Auto-create application user | app_user |
MYSQL_APP_USER_PASSWD | Application user password | userPass123! |
The production entrypoint script validates passwords and fails container startup if using defaults, enforcing security.
Sources: README.md203-226
Production images execute custom SQL scripts during first startup:
/sql-scripts in container.sql files in the directoryExample directory structure:
project/
├── sql-scripts/
│ ├── 01-schema.sql
│ ├── 02-seed-data.sql
│ └── 03-permissions.sql
└── docker-compose.yml
Sources: README.md141-186
From upstream fbraz3 images:
PHP__memory_limit=256M)/cronfile for automated task executionmail() functionSources: README.md231-248
| Scenario | Recommended Image | Rationale |
|---|---|---|
| Local development | fbraz3/lnmp:8.4-dev | phpMyAdmin included, no password required |
| CI/CD testing | fbraz3/lnmp:8.4-dev | Fast startup, no configuration needed |
| Production deployment | fbraz3/lnmp:8.4 | Secure by default, mandatory authentication |
| Phalcon applications | fbraz3/lnmp:8.4-phalcon | Framework pre-installed and configured |
| Legacy PHP support | fbraz3/lnmp:5.6 | Support for PHP 5.6+ applications |
| ARM-based hosts | Any tag | Multi-arch support (including Apple Silicon) |
Critical Warning: Never use -dev images in production. They have no root password, expose database ports, and include debugging tools.
Sources: README.md187-202
For practical usage examples and docker-compose configurations, see Quick Start Guide.
For detailed configuration options and environment variables, see Configuration Reference.
For internal container architecture and service interactions, see Container Architecture.
Complete Sources:
Refresh this wiki