docker 搭建php 开发环境 添加扩展redis、swoole、xdebug(2)

3、创建compose 的yml文件

version: "3.9"
services:
  #配置nginx
  nginx:
    #镜像名称 nginx:latest
    image: nginx
     #自定义容器的名称
     #container_name: c_nginx
    ports:
      - "80:80"

    #lnmp目录和容器的/usr/share/nginx/html目录进行绑定,设置rw权限
    #将宿主机的~/lnmp/nginx/conf/default.conf和容器的/etc/nginx/conf.d/default.conf进行绑定
    volumes:
      - ./data/:/usr/share/nginx/html:rw
      - ./nginx/conf/default.conf:/etc/nginx/conf.d/default.conf
    

你可能感兴趣的:(开发框架案例,开发代码例子,项目开发框架案例,docker,php,redis)