An easy-to-use LNMP/LEMP image, with Ubuntu Linux, Nginx, MySQL, PHP-FPM and PHPMyAdmin =)
50K+
This repository provides Docker images for LNMP stack (Linux, Nginx, MariaDB, and PHP-FPM), commonly referred to as LEMP.
It is designed to simplify the deployment of PHP applications with a robust and modern environment, offering both Development and Production versions to meet different deployment needs.
The images are built on top of other modular images from the fbraz3 ecosystem, ensuring flexibility, maintainability, and ease of use.
š” For a complete list of available images, please visit the PHP System Docsā page.
This project provides two distinct versions for different use cases:
-dev suffix)/pma/ endpointThe image follows a consistent tagging scheme:
fbraz3/lnmp:{php_version} (e.g., 8.2, 8.3, 8.4)fbraz3/lnmp:{php_version}-dev (e.g., 8.2-dev, 8.3-dev)fbraz3/lnmp:{php_version}-phalcon (e.g., 8.2-phalcon, 8.3-phalcon)fbraz3/lnmp:{php_version}-phalcon-dev (e.g., 8.2-phalcon-dev)fbraz3/lnmp:latest - Latest production versionfbraz3/lnmp:latest-dev - Latest development versionfbraz3/lnmp:latest-phalcon - Latest Phalcon production versionfbraz3/lnmp:latest-phalcon-dev - Latest Phalcon development versionamd64 and arm64 architecturesfbraz3/lemp:{tag}This image supports multiple flavors to cater to different use cases:
Perfect for local development with easy database access and debugging tools.
# docker-compose.yml
services:
web:
image: fbraz3/lnmp:8.4-dev # or fbraz3/lnmp:8.4-phalcon-dev
volumes:
- ./:/app/public/
ports:
- "127.0.0.1:80:80"
- "127.0.0.1:3306:3306"
Access Points:
http://localhost/http://localhost/pma/localhost:3306 (user: root, password: empty)Secure configuration suitable for production environments.
# docker-compose.yml
services:
web:
image: fbraz3/lnmp:8.4 # or fbraz3/lnmp:8.4-phalcon
environment:
- MYSQL_ROOT_PASSWORD=your_secure_password_here
- MYSQL_APP_DATABASE=my_application # Optional: create app database
- MYSQL_APP_USER=app_user # Optional: create app user
- MYSQL_APP_USER_PASSWD=app_password # Optional: app user password
volumes:
- ./:/app/public/
- mysql_data:/var/lib/mysql
ports:
- "80:80"
restart: unless-stopped
volumes:
mysql_data:
Access Points:
http://your-domain/root, password: set via environment)Important: Always set a strong MYSQL_ROOT_PASSWORD in production!
The production images support executing custom SQL scripts during container startup. This feature allows you to initialize your database with custom schema, data, or configuration.
.sql files in a directory on your host system/sql-scripts in the container.sql files in the directory will be executed automatically during first startup# docker-compose.yml
services:
web:
image: fbraz3/lnmp:8.4
environment:
- MYSQL_ROOT_PASSWORD=your_secure_password_here
volumes:
- ./:/app/public/
- ./sql-scripts:/sql-scripts # Mount your custom SQL scripts
- mysql_data:/var/lib/mysql
ports:
- "80:80"
restart: unless-stopped
# Directory structure example
project/
āāā sql-scripts/
ā āāā 01-create-users.sql
ā āāā 02-create-tables.sql
ā āāā 03-insert-data.sql
āāā docker-compose.yml
01-, 02-) to control execution order| Variable | Required | Default | Description |
|---|---|---|---|
MYSQL_ROOT_PASSWORD | Yes | defaultrootpassword | Root password for MariaDB |
MYSQL_APP_DATABASE | No | - | Create application database |
MYSQL_APP_USER | No | - | Create application user |
MYSQL_APP_USER_PASSWD | No | - | Password for application user |
Example:
docker run -e MYSQL_ROOT_PASSWORD=mySecurePassword123 \
-e MYSQL_APP_DATABASE=my_app \
-e MYSQL_APP_USER=app_user \
-e MYSQL_APP_USER_PASSWD=app_secure_password \
fbraz3/lnmp:8.4
Note:
MYSQL_APP_USER and MYSQL_APP_USER_PASSWD are provided, the user will be granted full privileges on the database specified by MYSQL_APP_DATABASE (if provided).MYSQL_APP_USER and MYSQL_APP_USER_PASSWD must be used together. Creating a user without a password is a security risk and is not supported.Development images don't require any specific environment variables and work out of the box.
This image allows you to customize PHP directives using environment variables.
For detailed instructions, refer to the php-fpm-docker documentationā .
Cronjobs can be configured by binding a file to /cronfile in the container. The system will automatically install and execute the jobs.
For more details, see the php-fpm-docker documentationā .
To enable email sending, this image relies on the configuration provided in the php-base-docker project.
Follow the instructions in the php-base-docker documentationā to set up email functionality.
Contributions are welcome! Feel free to open issues or submit pull requests to improve the project.
Please visit the CONTRIBUTING.mdā file for guidelines on how to contribute to this project.
I spend a lot of time and effort maintaining this project. If you find it useful, consider supporting me with a donation:
This project is licensed under the Apache License 2.0ā , so you can use it for personal and commercial projects. However, please note that the images are provided "as is" without any warranty or guarantee of any kind. Use them at your own risk.
Content type
Image
Digest
sha256:09a4b0bbeā¦
Size
344.6 MB
Last updated
7 days ago
docker pull fbraz3/lnmp:7.0-phalcon