LNMP Docker

735 阅读2分钟
原文链接: github.com

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.

Changelog

Updates every month, Version name is YY.MM. For more release information about LNMP Docker Version, see Releases.

Prerequisites

To use LNMP Docker, you need:

Quick Start

Windows 10

Please see Windows 10.

Install

Pick one method install LNMP Docker.

  • using the convenience script

    $ curl -fsSL lnmp.khs1994.com -o lnmp.sh ; sh lnmp.sh
  • using git clone

    $ git clone --recursive https://github.com/khs1994-docker/lnmp.git
    
    # $ git clone --recursive git@github.com:khs1994-docker/lnmp.git

Start

$ cd lnmp

$ ./lnmp-docker.sh development

$ curl 127.0.0.1

Welcome use khs1994-docker/lnmp v18.02 x86_64 With Pull Docker Image

development

Start PHP Project

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

# $ ./lnmp-docker.sh new

$ ./lnmp-docker.sh restart nginx

Issue SSL certificate

Powered by acme.sh

$ ./lnmp-docker.sh ssl www.khs1994.com

Only Support dnspod.cn DNS,Please set API key and id in .env file. 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.sh build.

Restart

# Restart all container
$ ./lnmp-docker.sh restart

$ ./lnmp-docker.sh restart nginx php7

Stop

$ ./lnmp-docker.sh stop

Stop and remove

$ ./lnmp-docker.sh down

Run LNMP On Kubernets

For more information please see Documents

Overview

Features

Please see Documents.

What's inside

Name Docker Image Version Based
NGINX nginx:1.13.8-alpine GitHub release Alpine:3.5
Apache httpd:2.4.29-alpine GitHub release Alpine:3.6
MySQL mysql:8.0.3 GitHub release Debian:jessie
MariaDB mariadb:10.3.4 GitHub release Debian:jessie
Redis khs1994/redis:4.0.8-alpine GitHub release Alpine:3.7
PHP-FPM khs1994/php-fpm:7.2.2-alpine3.7 GitHub release Alpine:3.7
Laravel khs1994/php-fpm:7.2.2-alpine3.7 GitHub release Alpine:3.7
Composer khs1994/php-fpm:7.2.2-alpine3.7 GitHub release Alpine:3.7
Memcached memcached:1.5.4-alpine GitHub release Alpine:3.7
RabbitMQ khs1994/rabbitmq:3.7.2-management-alpine GitHub release Alpine:3.7
PostgreSQL khs1994/postgres:10.1-alpine GitHub release Alpine:3.6
MongoDB mongo:3.7.1 GitHub release Debian:jessie

Folder Structure

Folder description
app PHP project (HTML, PHP, etc)
backup backup database file
config configuration file
dockerfile Dockerfile
logs logs file
scripts bash shell script
tmp Composer cache file ,etc

Exposed Ports

  • 80
  • 443

CLI

Easy to access Laravel, Laravel artisan, composer, PHP-CLI, etc. Please use ./lnmp-docker.sh.

Run in Production

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

LinuxKit

# OS: macOS

$ cd 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

TLSv1.3

Please see khs1994-website/tls-1.3

CI/CD

Please see khs1994-docker/ci

Docker Daemon TLS

Please see khs1994-docker/dockerd-tls

Documents

doc.lnmp.khs1994.com

Contributing

Please see Contributing

Thanks

More Information

Donate

Please see zan.khs1994.com