1.7 KiB
1.7 KiB
docker-lemp
Overview
docker-lemp is a Docker-based LEMP stack (Linux, Nginx, MySQL, PHP) for local development. This setup allows you to quickly spin up a LEMP environment for your web applications.
Features
- Nginx: High-performance web server.
- MySQL: Popular relational database management system.
- PHP: Server-side scripting language.
- Docker Compose: Tool for defining and running multi-container Docker applications.
Prerequisites
- Docker
- Docker Compose
Getting Started
-
Clone the repository:
git clone https://git.hpz.pw/hpz937/docker-lemp.git cd docker-lemp -
Build and start the containers:
docker-compose up --build -
Access your application:
- Web server:
https://localhost
- Web server:
Configuration
- Nginx: Configuration files are located in the
nginxdirectory. - PHP: Configuration files are located in the
phpfpmdirectory.
SSL
To generate a self-signed SSL certificate and dhparam.pem, follow these steps:
-
Create the
nginx/ssldirectory if it doesn't exist:mkdir ssl -
Generate a self-signed SSL certificate:
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout ssl/key.pem -out ssl/cert.pem -
Generate a
dhparam.pemfile:openssl dhparam -out ssl/dhparam.pem 2048
These files will be used by Nginx for SSL termination.
Usage
-
To stop the containers:
docker-compose down -
To rebuild the containers:
docker-compose up --build
Contributing
Contributions are welcome! Please open an issue or submit a pull request.
License
This project is licensed under the MIT License. See the LICENSE file for details.