Skip to content

A basic LAMP stack environment for local development.

License

Notifications You must be signed in to change notification settings

andreipa/docker-lamp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker LAMP Development v1.0.2

License: MIT

A very basic LAMP stack environment for development. It was built using Docker Compose 3.7 and consists following:

For PHP 5.6 you can change to the branch php-5

Getting Started

Clone this repository on your local computer and run the docker compose on your terminal.

docker-compose up -d --build

Prerequisites

In order to run this container you'll need docker installed.

Usage

Installation

Clone this repository on your local computer and run the docker compose on your terminal.

git clone https://github.com/andreipa/docker-lamp
cd docker-lamp/
git fetch --all
docker-compose up -d --build

You can access your LAMP stack via http://localhost

Configuration

This package comes with default configuration options. You can modify them by editing the Dockerfile inside the folders ./bin/mysql and ./bin/webserver.

Environment Variables

  • DOCUMENT_ROOT - The document root for the Apache server. The default value is ./www. All your sites will go here and will be synced automatically.
  • VHOSTS_DIR - The virtual hosts. The default value for this is ./config/vhosts. You can place your virtual hosts conf files here.
  • APACHE_LOG_DIR - This will be used to store Apache logs. The default value for this is ./logs/apache2.
  • MYSQL_LOG_DIR - This will be used to store Apache logs. The default value for this is ./logs/mysql.
  • MYSQL_DATA_DIR - This is MySQL data directory. The default value for this is ./data/mysql. All your MySQL data files will be stored here.
  • PHP_INI - The file php.ini with custom configuration. You can customise as you need and saving it at ./config/php/.

Database Environment Variables

  • DB_ROOT_PASSWORD - The root password of the MySQL. Default root.
  • DB_USER - Optional user name with superuser permissions. Default user.
  • DB_PASSWORD - Optional password for the user. Default root.

Containers

Apache

Apache is configured to run on port 80. So, you can access it via http://localhost.

Apache Modules

By default following modules are enabled.

  • rewrite
  • headers

If you want to enable more modules. Just update ./bin/webserver/Dockerfile.

Connect via SSH

You can connect to web server using docker exec command to perform various operation on it. Use below command to login to container via ssh.

docker exec -it 7.3.x-webserver /bin/bash

PHP

The installed version of PHP is 7.3

Extensions

By default following extensions are installed.

  • bcmath
  • calendar
  • curl
  • exif
  • gettext
  • imagick-3.4.3
  • mysqli
  • pdo_sqlite
  • xdebug-2.7.0RC1
  • zip

If you want to install more extension, just update ./bin/webserver/Dockerfile.

Built With

  • Debian
  • Composer

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Author

  • Andrei Andrade - Initial work - andreipa

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Acknowledgments