基于Docker 构建 PHP 环境
DockerFile 地址https://github.com/m15140482647/docker-php-web.git基于docker 构建php + nginx + mysql + redis的web环境版本:PHP 7.2 redis swoole 扩展Mysql 5.6openresty 1.11.2.3安装文件:docker-compose.yamlversion: '2'serv
·
DockerFile 地址 https://github.com/m15140482647/docker-php-web.git
基于docker 构建php + nginx + mysql + redis的web环境
版本:
PHP
7.2 redis swoole 扩展
Mysql
5.6
openresty
1.11.2.3
安装文件:
docker-compose.yaml
version: '2'
services:
cgi:
container_name: php7.2
image: reader1/php_ext_redis_swoole:7.2
restart: always
expose:
- "9000"
ports:
- "9000:9000"
volumes:
- ../myspace:/www/workspace/
depends_on:
- mysql
- redis
links:
- mysql:mysql
- redis:redis
nginx:
container_name: nginx_v1
image: reader1/openresty:1
restart: always
volumes:
- ./config/nginx:/etc/nginx/conf.d
- ./logs/nginx:/var/log/nginx
- ../myspace:/www/workspace/:ro
ports:
- 80:80
- 443:443
mysql:
container_name: mysql
image: daocloud.io/library/mysql:5.6
restart: always
expose:
- "3306"
ports:
- "3306:3306"
volumes:
- ./runtime/var_lib_mysql:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=zydc
redis:
container_name: redis
image: daocloud.io/library/redis
restart: always
expose:
- "6379"
ports:
- "6379:6379"
volumes:
- ./runtime/var_lib_redis:/data
command: redis-server --appendonly yes
使用方法
安装docker
安装docker-compose
安装yaml 执行安装命令
docker-compose up -d
DONE !!!
更多推荐
已为社区贡献1条内容
所有评论(0)