💻 🐳 🐘 🐬 🐧 🚀 Start Docker LNMP(LEMP) In less than 2 minutes Powered by Docker Compose. 让 PHP 开发者快速(一键)搭建基于容器技术(Docker、Kubernetes)的开发、测试、生产(CI/CD by Drone)环境.
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Go to file
Kang Huaishuai 54c6277f19
Merge branch '20.10'
1 week ago
.devcontainer Update soft version 10 months ago
.github Merge branch '20.10' 1 week ago
.vscode [vsCode] Update settings 2 months ago
app [Nginx] Update to v1.23.3 4 weeks ago
bin [MysqL] Update to v8.0.30 7 months ago
cli [cli] remove compose cmd 7 months ago
cluster deploy swarm need version: "3.9" 7 months ago
config [WSL] Add debian apt source config file 4 weeks ago
dockerfile [Nginx] Update stable version to v1.22.1 4 weeks ago
docs [PHP] Update to v8.1.9 v8.0.23 2 months ago
drone [Nginx] Update to v1.23.3 4 weeks ago
kubernetes [Kubernetes] Test v1.27.0-rc.0 [sync git] 1 week ago
log Rename logs to log 5 years ago
lrew [PHP] Update to v8.1.9 v8.0.23 2 months ago
pcit Update demo config 10 months ago
scripts [Deno] Update to v1.31.1 4 weeks ago
secrets [minio] Update conf 2 years ago
tls Update cert 10 months ago
vscode-remote [PHP] Update to v8.1.9 v8.0.23 2 months ago
windows [lwpm] Add start command 1 week ago
wsl [Go] Update to v1.20.1 4 weeks ago
wsl2 [WSL2] Update kernel config 4 weeks ago
.appveyor.yml Merge branch '20.10' 1 week ago
.editorconfig [LWPM] store lwpm package to docker registry, not composer 3 years ago
.env.example [Nginx] Update to v1.23.3 4 weeks ago
.env.example.ps1 [PHP] Update to v8.1.9 v8.0.23 2 months ago
.env.global Update soft version 2 years ago
.git.template add s6 image, when build s6 image you can bind it [sync git] 3 years ago
.gitattributes Repo language is Dockerfile [skip ci] 4 years ago
.gitignore [Kubernetes] Update to v1.25.0 [sync git] 7 months ago
.pcit.yml [PHP] Update to v8.1.9 v8.0.23 2 months ago
CHANGELOG.md [Nginx] Update to v1.23.3 4 weeks ago
CONTRIBUTING.md new 20.10 branch 2 years ago
LICENSE Merge branch 'dev' 5 years ago
README.cn.md Merge branch '20.10' 1 week ago
README.md Merge branch '20.10' 1 week ago
RELEASE.md rename lnmp-laravel-by-composer to lnmp-laravel 3 years ago
TODO.md [Compose V2] use compose v2 7 months ago
docker-lnmp.override.example.yml [PHP] Update to v8.1.9 v8.0.23 2 months ago
docker-lnmp.yml [Nginx] Update to v1.23.3 4 weeks ago
docker-production.yml [Nginx] Update to v1.23.3 4 weeks ago
docker-workspace.example.yml [PHP] Update to v8.1.9 v8.0.23 2 months ago
lnmp-docker remove local gcr.io code 4 weeks ago
lnmp-docker-custom-script.example [MySQL] Update config 10 months ago
lnmp-docker-custom-script.example.ps1 Update s6 config 9 months ago
lnmp-docker.ps1 remove local gcr.io code 4 weeks ago
lpm.ps1 Update lpm 2 months ago
renovate.json fixed renovate ci 2 years ago

README.md

LNMP Docker

GitHub stars GitHub release GitHub (pre-)release license Build Status

star

💻 🐳 🐘 🐬 🐧 🚀 Start LNMP In Less than 2 minutes Powered By Docker Compose, one command $ ./lnmp-docker up

Platform Status
Windows Build status
Linux Build Status
macOS CI
Linux arm64v8 -

LNMP Docker is supported on Linux, macOS, Windows 10 on x86_64, and Debian (Raspberry Pi3) on arm.

⚠️ Don't Edit Any Files except .env Why ?

⚠️ Run Laravel on Docker For Windows very slow. solve it.

🎁 Donate

WeChat

Welcome developer subscribe WeChat

Prerequisites

To use LNMP Docker, you need:

1 Git

2 Docker CE 19.03 Stable +

3 Docker Compose V2

4 WSL (Windows Only)

Quick Start

Windows 10

Please see Windows 10.

Install

Use git install LNMP Docker.

$ git clone --depth=1 https://github.com/khs1994-docker/lnmp.git

# $ git clone --depth=1 git@github.com:khs1994-docker/lnmp.git

# 中国镜像

$ git clone --depth=1 https://gitee.com/khs1994-docker/lnmp.git

# $ git clone --depth=1 git@gitee.com:khs1994-docker/lnmp.git

Start LNMP Demo

$ cd lnmp

$ ./lnmp-docker up

$ curl 127.0.0.1

Welcome use khs1994-docker/lnmp v20.10 x86_64 With Pull Docker Image

development

💡 MySQL default root password mytest

Start PHP Project

Create new folder to start PHP project(e.g, Laravel) in ./app/ folder, And edit nginx config file in ./config/nginx/yourfilename.conf.

# $ ./lnmp-docker new

$ ./lnmp-docker restart nginx

You can set APP_ROOT to change PHP project folder.

More information please see Docker PHP Best Practice https://github.com/khs1994-docker/php-demo

How to connect Services

$redis = new \Redis();

- $redis->connect('127.0.0.1',6379);
+ $redis->connect('redis', 6379);

- $pdo = new \PDO('mysql:host=127.0.0.1;dbname=test;port=3306','root','mytest');
+ $pdo = new \PDO('mysql:host=mysql,dbname=test,port=3306', 'root', 'mytest');

Advanced

PHPer commands

  • lnmp-php

  • lnmp-composer

  • lnmp-phpunit

  • lnmp-laravel

  • ...

For more information please see Documents

Issue SSL certificate

Powered by acme.sh

$ ./lnmp-docker ssl khs1994.com -d *.khs1994.com

Please set API key and id in .env file or System ENV. Support Self-Signed SSL certificate, for more information, see Documents.

List LNMP Container

$ docker container ls -a -f label=com.khs1994.lnmp

Use Self-Build Docker Image

Edit Dockerfile in ./dockerfile/*/Dockerfile, then exec ./lnmp-docker build.

Restart

# Restart all container
$ ./lnmp-docker restart

$ ./lnmp-docker restart nginx php8

Stop

$ ./lnmp-docker stop

Stop and remove

$ ./lnmp-docker down

Overview

Features

Please see Documents.

What's inside

Name Docker Image Version Based
ACME.sh khs1994/acme:3.0.0 3.0.0 alpine:3.16
NGINX nginx:1.23.3-alpine 1.23.3 alpine:3.13
NGINX Unit khs1994/php:8.1.9-unit-alpine 1.28.0 alpine:3.16
HTTPD httpd:2.4.53-alpine 2.4.53 alpine:3.16
MySQL mysql:8.0.30 8.0.30 oraclelinux:8-slim
MariaDB mariadb:10.8.3 10.8.3 ubuntu:jammy
Redis redis:7.0.0-alpine 7.0.0 alpine:3.16
PHP-FPM khs1994/php:8.1.9-fpm-alpine 8.1.9 alpine:3.16
Composer khs1994/php:8.1.9-composer-alpine 2.5.1 alpine:3.16
Memcached memcached:1.6.15-alpine 1.6.15 alpine:3.16
RabbitMQ rabbitmq:3.9.0-management-alpine 3.9.0 alpine:3.13
PostgreSQL postgres:14.0-alpine 14.0 alpine:3.14
MongoDB mongo:5.0.3 5.0.3 ubuntu:bionic
PHPMyAdmin phpmyadmin:5.2.0 5.2.0 alpine:3.16
Registry registry:latest latest alpine:3.11

Folder Structure

Folder description
app PHP project (HTML, PHP, etc)
scripts/backup backup database file
bin PHPer Commands
config configuration file
dockerfile Dockerfile
log log file
scripts bash shell script

Exposed Ports

  • 80
  • 443

CLI

Easy to generate nginx or apache config, etc. Please use ./lnmp-docker.

Who use in Production?

khs1994.com

PCIT -- PHP CI TOOLKIT

HTTP3/QUIC

Please see https://github.com/khs1994-docker/lnmp/issues/895

CI/CD

Please see khs1994-docker/ci

Documents

https://docs.lnmp.khs1994.com

Contributing

Please see Contributing

Thanks

More Information

Donate

Please see https://zan.khs1994.com

Privacy

We send OS type and IP data to us data collection server, please set true (default) to help us improve.

You can edit .env file DATA_COLLECTION=false to disable it.