Forked from micooz/docker-lnmp
Deploy enhanced lnmp(Linux, Nginx, MySQL, PHP7, Memcached, Redis) using docker for your development.
Using daocloud mirror as base docker image.
- daocloud.io/nginx:latest
- daocloud.io/php:7.0.5-fpm
- daocloud.io/mysql:latest
- daocloud.io/memcached:latest
- daocloud.io/redis:latest
The whole app is divided into five Containers:
- Nginx is running in
lnmp-nginxContainer, which handles requests and makes responses. - PHP or PHP-FPM is put in
lnmp-fpmContainer, it retrieves php scripts from host, interprets, executes then responses to Nginx. It installed extensions yii and laravel needs. If necessary, it will connect toMySQLas well. - MySQL lies in
lnmp-mysqlContainer, - Memcached for web cache lies in
lnmp-memcachedContainer. - Redis for web k-v database lies in
lnmp-redisContainer.
Our app scripts are located on host, you can edit files directly without rebuilding/restarting whole images/containers.
- Setup php-development.ini if necessary.
[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- Setup docker-compose.yml, mount your website directory on the nginx and fpm container.
nginx:
volumes:
# Mount www here.
- ./app/src:/usr/share/nginx/html
fpm:
volumes:
# Mount www here.
- ./app/src:/usr/share/nginx/html- Add nginx conf file of your website into nginx/conf.d/, you may refer to nginx/conf.d/default.conf.sample.
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 🍺
teddywen 763323819@qq.com
MIT
