πŸ’» 🐳 🐘 🐬 🐧 πŸš€ Start LNMP(LEMP) In less than 2 minutes Powered by Docker Compose. The GOAL of this project is to help PHPer Run LNMP On Kubernetes In production environment.
Clone or download
Latest commit 8f8a94a Oct 24, 2018
Permalink
Failed to load latest commit information.
.github Update app/demo Sep 19, 2018
ad Add ad [skip ci] Oct 3, 2018
app Release v18.06.06-rc1 Oct 19, 2018
backup Update NODE GIT version Oct 11, 2018
bin MySQL 8.0.13 Oct 24, 2018
cli Merge branch '18.06' Oct 21, 2018
cluster Update ClusterKit MySQL [skip ci] Aug 3, 2018
config Release v18.06.06-rc1 Oct 19, 2018
dockerfile-arm32v7 PHP 7.2.11 7.1.23 7.3.0RC3 Oct 14, 2018
dockerfile-arm64v8 PHP 7.2.11 7.1.23 7.3.0RC3 Oct 14, 2018
dockerfile-windows MySQL 8.0.13 Oct 24, 2018
dockerfile PostgreSQL 11.0 GA Oct 24, 2018
docs add image Oct 21, 2018
drone MySQL 8.0.13 Oct 24, 2018
env.example Update minio version [skip ci] Sep 13, 2018
frontend Rename frontend folder Jul 12, 2018
kubernetes MySQL 8.0.13 Oct 24, 2018
linuxkit Redis 5.0.0 GA Oct 18, 2018
lnmpkit Update NGINX 1.15.3 Aug 29, 2018
log Rename logs to log Sep 4, 2018
pcit PHP 7.2.11 7.1.23 7.3.0RC3 Oct 14, 2018
scripts Update app/demo Sep 19, 2018
secrets Remove gitlab gogs, Support minio Sep 3, 2018
volumes Update k8s [skip ci] Sep 1, 2018
windows Fix Windows Python Oct 24, 2018
wsl MySQL 8.0.13 Oct 24, 2018
.editorconfig Update editorconfig Sep 24, 2018
.env.example PostgreSQL 11.0 GA Oct 24, 2018
.env.example.ps1 MySQL 8.0.13 Oct 24, 2018
.gitattributes Merge branch 'dev' Mar 14, 2018
.gitignore Update k8s [skip ci] Sep 4, 2018
.pcit.yml PHP 7.2.11 7.1.23 7.3.0RC3 Oct 14, 2018
.travis.yml Merge branch '18.06' Oct 21, 2018
CHANGELOG.md Merge branch '18.06' Oct 16, 2018
CONTRIBUTING.md Merge branch 'dev' Mar 28, 2018
LICENSE Merge branch 'dev' Feb 24, 2018
README.cn.md Merge branch '18.06' Oct 24, 2018
README.md Merge branch '18.06' Oct 24, 2018
composer.json next version is 18.09 [skip ci] Sep 12, 2018
docker-arm.yml Merge branch '18.06' Oct 24, 2018
docker-cluster.memcached.yml Memcached 1.5.11 Oct 14, 2018
docker-cluster.mysql.yml MySQL 8.0.13 Oct 24, 2018
docker-cluster.nginx.yml NGINX 1.15.5 Oct 3, 2018
docker-cluster.redis.replication.yml Release v18.06.06-rc1 Oct 19, 2018
docker-cluster.redis.sentinel.yml Release v18.06.06-rc1 Oct 19, 2018
docker-cluster.redis.yml Redis 5.0.0 GA Oct 18, 2018
docker-compose.build.yml Merge branch '18.06' Sep 26, 2018
docker-compose.override.yml MySQL 8.0.13 Oct 24, 2018
docker-compose.yml Merge branch '18.06' Oct 24, 2018
docker-example.yml MySQL 8.0.13 Oct 24, 2018
docker-pcit.include.yml PHP 7.2.11 7.1.23 7.3.0RC3 Oct 14, 2018
docker-production.yml Merge branch '18.06' Oct 24, 2018
docker-windows.yaml MySQL 8.0.13 Oct 24, 2018
lnmp-docker php-cs-fixer 2.13.1 Oct 21, 2018
lnmp-docker.ps1 php-cs-fixer 2.13.1 Oct 21, 2018
renovate.json Update KhsCI support [TEST] May 17, 2018

README.md

LNMP Docker

GitHub stars PHP from Packagist Build Status GitHub release GitHub (pre-)release license Build Status

star

πŸ’» 🐳 🐘 🐬 🐧 πŸš€ Start LNMP In Less than 2 minutes Powered By Docker Compose.

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, you can try WSL.

WeChat

Welcome developer subscribe WeChat

Prerequisites

To use LNMP Docker, you need:

1️⃣ Docker CE 18.06 Stable +

2️⃣ Docker Compose 1.22.0+

3️⃣ 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 v18.09 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->connect('127.0.0.1',6379);

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

$redis = new \Redis();

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

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

Advanced

Need PHP Under 7.1?

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

Meet issues With MySQL 8.0 ?

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

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 php7

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:2.7.9 2.7.9 Alpine:3.8
NGINX khs1994/nginx:1.15.5-alpine 1.15.5 Alpine:3.8
NGINX Unit khs1994/nginx-unit:1.4-alpine 1.4 Alpine:3.8
HTTPD httpd:2.4.37-alpine 2.4.37 Alpine:3.7
MySQL mysql:8.0.13 8.0.13 Debian:stretch
MariaDB mariadb:10.3.10 10.3.10 Ubuntu:bionic
Redis redis:5.0.0-alpine 5.0.0 Alpine:3.8
PHP-FPM khs1994/php:7.2.11-fpm-alpine 7.2.11 Alpine:3.8
Laravel khs1994/php:7.2.11-fpm-alpine 5.7.x Alpine:3.8
Composer khs1994/php:7.2.11-fpm-alpine 1.7.2 Alpine:3.8
PHP-CS-Fixer khs1994/php:7.2.11-fpm-alpine 2.13.1 Alpine:3.8
Memcached memcached:1.5.11-alpine 1.5.11 Alpine:3.8
RabbitMQ rabbitmq:3.7.8-management-alpine 3.7.8 Alpine:3.8
PostgreSQL postgres:11.0-alpine 11.0 Alpine:3.8
MongoDB mongo:4.1.4 4.1.4 Ubuntu:xenial
PHPMyAdmin phpmyadmin/phpmyadmin:latest latest Alpine:3.8
Registry registry:latest latest Alpine:3.4

Folder Structure

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

Exposed Ports

  • 80
  • 443
  • 8080 PHPMyAdmin (Development only)

CLI

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

Run in Production

Start Containers as a Service(CaaS). For more information, see Documents.

LinuxKit

# OS: macOS

$ cd toolkit/linuxkit

$ linuxkit build lnmp.yml

$ linuxkit run -publish 8080:80/tcp lnmp

Open your Browers 127.0.0.1:8080

Who use in Production?

khs1994.com

PCIT PHP CI TOOLKIT

TLS1.3

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

CI/CD

Please see khs1994-docker/ci

Documents

https://doc.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.

AD 🐳