diff --git a/README.md b/README.md index 85152e8..95d7e13 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # php-nginx-mysql-compose docker-compose php + nginx + mysql +参考[ocker-compose搭建nginx+php+mysql](https://www.jianshu.com/p/0561d3cfccda) ## 安装docker ``` diff --git a/docker-compose.yml b/docker-compose.yml index b4e69da..09ca372 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,18 +12,18 @@ services: volumes: # 映射主机./conf.d目录到容器/etc/nginx/conf.d目录 - "$PWD/conf.d:/etc/nginx/conf.d" - - "$PWD/html:/usr/share/nginx/html" + - "/sharedfolders/web/site80/html:/usr/share/nginx/html" networks: - app_net # 容器名称 container_name: "compose-nginx" php: build: ./php-mysqli - image: php:7.2-fpm-mysqli + image: php:7.3-fpm-mysqli ports: - "9000:9000" volumes: - - "$PWD/html:/var/www/html" + - "/sharedfolders/web/site80/html:/var/www/html" networks: - app_net container_name: "compose-php" @@ -34,11 +34,11 @@ services: # 环境变量 environment: # mysql密码 - - MYSQL_ROOT_PASSWORD=123456 + - MYSQL_ROOT_PASSWORD=lldlcj123 networks: app_net: - # 固定子网ip,网段必须在子网络10.10.*.* - ipv4_address: 10.10.10.1 + # 固定子网ip,网段必须在子网络192.168.8.* + ipv4_address: 192.168.8.6 container_name: "compose-mysql" networks: # 配置docker network @@ -47,4 +47,4 @@ networks: ipam: config: # 子网络 - - subnet: 10.10.0.0/16 + - subnet: 192.168.8.0/24 diff --git a/php-mysqli/Dockerfile b/php-mysqli/Dockerfile index 46cc25c..007841f 100644 --- a/php-mysqli/Dockerfile +++ b/php-mysqli/Dockerfile @@ -1,4 +1,4 @@ -FROM php:7.2-fpm +FROM php:7.3-fpm RUN apt-get update \ && apt-get install iputils-ping \