Skip to content

A basic LEMP (Linux(Ubuntu), Nginx, Mysql and PHP) stack environment built using Docker Compose.

License

Notifications You must be signed in to change notification settings

jerfeson/docker-compose-lemp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ALAMP (Linux (Ubuntu), Nginx, Mysql & PHP) stack built with Docker Compose

Landing Page

This is a basic ALAMP stack environment built using Docker Compose. It consists following:

  • PHP 7.3.X
  • Nginx
  • MySQL 5.7
  • phpMyAdmin
  • Redis

Installation

Clone this repository on your local computer. Run the docker-compose up -d.

git clone https://github.com/jerfeson/docker-compose-lemp.git
cd docker-compose-lemp/
git fetch --all
git checkout 7.3.x
cp sample.env .env
docker-compose up -d

Please make sure that you are using 7.3.x branch.

Your ALAMP stack is now ready!! You can access it via http://localhost.

Configuration

To make it easy, just copy the content from sample.env file and update the environment variable values as per your need.

Configuration Variables

There are following configuration variables available and you can customize them by overwritting in your own .env file.

DOCUMENT_ROOT

It is a document root for Nginx server. The default value for this is ./www. All your sites will go here and will be synced automatically.

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.

VHOSTS_DIR

This is for virtual hosts. The default value for this is ./config/apache/vhosts. You can place your virtual hosts conf files here.

Make sure you add an entry to your system's hosts file for each virtual host.

APACHE_LOG_DIR

This will be used to store Nginx logs. The default value for this is ./logs/apache2.

MYSQL_LOG_DIR

This will be used to store Nginx logs. The default value for this is ./logs/mysql.

Web Server

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

Nginx Modules

By default following modules are enabled.

mod_rewrite is already included in the httpd package, and is loaded in the default configuration. Use the RewriteEngine directive to enable it as required.

Connect via SSH

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

docker-compose exec webserver bash

PHP

The installed version of PHP is 7.3.x

By default following extensions are installed.

  • devel (dev)
  • cli
  • common
  • gd
  • jsonc (json)
  • pear
  • mbstring
  • mysqlnd (mysql)
  • pdo
  • redis
  • soap
  • xdebug
  • xml
  • xmlrpc

If you want to install more extension, just update ./bin/webserver/Dockerfile. You can also generate a PR and we will merge if seems good for general purpose. You have to rebuild the docker image by running docker-compose build and restart the docker containers.

phpMyAdmin

phpMyAdmin is configured to run on port 8080. Use following default credentials.

http://localhost:8080/
username: root
password: root

Redis

It comes with Redis. It runs on default port 6379.

Contributing

welcome to discuss a bugs, features and ideas.

License

jerfeson/docker-compose-lemp is release under the MIT license.

About

A basic LEMP (Linux(Ubuntu), Nginx, Mysql and PHP) stack environment built using Docker Compose.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published