Antoni Nuñez Romeu 5dba917cfc
All checks were successful
Deploy LAMP / Deploy LAMP (push) Successful in 7m12s
Fix PHP Dockerfile: replace xml-dev with libxml2-dev and correct nproc typo
2026-04-13 17:28:00 +02:00
2026-04-13 17:13:52 +02:00
2026-04-13 17:13:52 +02:00
2026-04-13 17:13:52 +02:00
2026-04-13 17:13:52 +02:00
2026-04-13 17:13:52 +02:00
2026-04-13 17:13:52 +02:00
2026-04-13 17:13:52 +02:00

Lightweight LAMP Stack with Docker

This repository contains a lightweight LAMP (Linux, Apache, MySQL, PHP) stack using Docker containers.

Features

  • Apache 2.4 (Alpine-based) - Web server with support for virtual hosts
  • PHP 8.4 (FPM Alpine-based) - Latest PHP version
  • MySQL 8.0 - Relational database
  • Adminer - Lightweight database management tool (alternative to phpMyAdmin)
  • Virtual Host Support - Easy to add new virtual hosts
  • Optimized Images - Using Alpine Linux for minimal footprint

Directory Structure

Docker-Lamp/
├── apache/           # Apache configuration and Dockerfile
├── php/              # PHP configuration and Dockerfile
├── mysql/            # MySQL configuration and Dockerfile
├── adminer/          # Adminer configuration and Dockerfile
├── html/             # Web root directory (mounted to containers)
├── docker-compose.yml # Docker Compose configuration
└── README.md         # This file

Quick Start

  1. Clone this repository
  2. Navigate to the project directory
  3. Start the stack:
docker-compose up -d
  1. Access the services:

Configuration

Apache Virtual Hosts

To add a new virtual host:

  1. Create a new .conf file in apache/vhosts/
  2. Configure your virtual host settings
  3. Restart Apache: docker-compose restart apache

Example virtual host configuration is provided in apache/vhosts/example.conf

Environment Variables

MySQL credentials are configured in docker-compose.yml:

  • Database: lamp_db
  • Username: lamp_user
  • Password: lamp_password
  • Root Password: root_password

Adminer uses these same credentials by default.

Customization

Changing PHP Version

Modify the PHP Dockerfile to use a different PHP version tag.

Adding PHP Extensions

Edit the PHP Dockerfile to install additional extensions using docker-php-ext-install.

Persistent Data

MySQL data is persisted in a Docker volume named mysql-data.

Stopping the Stack

docker-compose down

To remove volumes as well:

docker-compose down -v

Notes

  • All images are based on Alpine Linux for minimal size
  • Apache is configured to allow .htaccess overrides
  • PHP-FPM communicates with Apache via the shared volume
  • Adminer provides a clean, lightweight interface for database management
Description
No description provided
Readme 36 KiB
Languages
Dockerfile 95.5%
PHP 4.5%