Docker 学习第四课
搭建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
相关推荐
Noneyes 2020-11-10
zyyjay 2020-11-09
xuebingnan 2020-11-05
samtrue 2020-11-22
stefan0 2020-11-22
yifangs 2020-10-13
songshijiazuaa 2020-09-24
hebiwtc 2020-09-18
天步 2020-09-17
83911535 2020-11-13
whatsyourname 2020-11-13
zhouyuqi 2020-11-10
mathchao 2020-10-28
王志龙 2020-10-28
wwwsurfphpseocom 2020-10-28
diskingchuan 2020-10-23
savorTheFlavor 2020-10-23