码迷,mamicode.com
首页 > 其他好文 > 详细

Docker 学习第四课

时间:2020-06-28 18:24:12      阅读:69      评论:0      收藏:0      [点我收藏+]

标签:apach   nginx   conf   contain   ocs   version   nta   idg   搭建   

搭建php-fpm apache nginx 环境

docker-compose.yml文件

networks:
  net:
    driver: bridge
    ipam:
      config:
        - 
          subnet: 192.138.0.0/16
services:
  apache:
    container_name: php-apache
    image: "httpd:2.4-alpine"
    networks:
      net:
        ipv4_address: "192.138.0.4"
    ports:
      - "8081:80"
    volumes:
      - "/root/php/:/usr/local/apache2/htdocs/"
      - "/root/conf/httpd.conf:/usr/local/apache2/conf/httpd.conf"
  fpm:
    container_name: php-fpm
    image: "php:7.2.0-fpm-alpine3.6"
    networks:
      net:
        ipv4_address: "192.138.0.6"
    volumes:
      - "/root/php/:/php/"
  nginx:
    container_name: php-nginx
    image: "nginx:1.19.0-alpine"
    networks:
      net:
        ipv4_address: "192.138.0.5"
    ports:
      - "8082:80"
    volumes:
      - "/root/php:/usr/share/nginx/html"
      - "/root/conf/nginx.conf:/etc/nginx/nginx.conf"
version: "3.8"

2、启动容器

docker-compose up -d

Docker 学习第四课

标签:apach   nginx   conf   contain   ocs   version   nta   idg   搭建   

原文地址:https://www.cnblogs.com/qingxiaoping/p/13204082.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!