Skip to content

teddywen/docker-lnmp-yii-laravel

 
 

Repository files navigation

Forked

Forked from micooz/docker-lnmp

Introduction

Deploy enhanced lnmp(Linux, Nginx, MySQL, PHP7, Memcached, Redis) using docker for your development.

Docker Image

Using daocloud mirror as base docker image.

Architecture

architecture

The whole app is divided into five Containers:

  1. Nginx is running in lnmp-nginx Container, which handles requests and makes responses.
  2. PHP or PHP-FPM is put in lnmp-fpm Container, it retrieves php scripts from host, interprets, executes then responses to Nginx. It installed extensions yii and laravel needs. If necessary, it will connect to MySQL as well.
  3. MySQL lies in lnmp-mysql Container,
  4. Memcached for web cache lies in lnmp-memcached Container.
  5. Redis for web k-v database lies in lnmp-redis Container.

Our app scripts are located on host, you can edit files directly without rebuilding/restarting whole images/containers.

Configuration

[yaconf]
; Set your yaconf dir.
; yaconf.directory=/usr/share/nginx/html/intv/yaconfini
[xdebug]
; host is your local machine's ip
xdebug.remote_host = 192.168.8.154
xdebug.remote_port = 9000
; Set log if necessary。
; xdebug.remote_log = /tmp/xdebug_remote.log
nginx:
  volumes:
    # Mount www here.
    - ./app/src:/usr/share/nginx/html
fpm:
  volumes:
    # Mount www here.
    - ./app/src:/usr/share/nginx/html

Build and Run

At first, you should have had Docker and Docker Compose installed.

Without building images one by one, you can make use of docker-compose and simply issue:

$ sudo docker-compose up

Or using detached mode:

$ sudo docker-compose up -d

For more operations to containers, please refer to:

$ sudo docker-compose --help

Check out your http://localhost and have fun 🍺

Contributors

teddywen 763323819@qq.com

License

MIT

About

😒 Deploy lnmp(Linux, Nginx, MySQL, PHP7, Memcached, Redis) using docker.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%