2.將 php 5.2 , php 5.6 , nginx 全連結到 www_data
3.配置 nginx 的 conf 讓他服務多網站
代碼: 選擇全部
docker run --name=www_root -v ~/Sites:/var/www/html -d busybox echo wwwroot
代碼: 選擇全部
www_data:
image: busybox
volumes:
- ~/Sites:/var/www/html
hope_mysql:
container_name: hope_mysql
restart: always
image: mariadb:latest
environment:
- MYSQL_ROOT_PASSWORD=secret
- MYSQL_DATABASE=homestead
- MYSQL_USER=homestead
- MYSQL_PASSWORD=secret
volumes:
- ~/dockerdb/mysql:/var/lib/mysql/
php:
container_name: php
restart: always
image: tommylau/php-5.2
links:
- hope_mysql:db
environment:
- DB_HOST=hope_mysql
volumes_from:
- www_data
php56:
container_name: php56
restart: always
image: myphp:5.6-fpm
links:
- hope_mysql:db
environment:
- DB_HOST=hope_mysql
volumes_from:
- www_data
hope_nginx:
container_name: hope_nginx
restart: always
image: local/nginx
ports:
- "80:80"
links:
- php:php
- php56:php56
volumes:
- ~/Sites/docker-auto/conf.d:/etc/nginx/conf.d
volumes_from:
- www_data
代碼: 選擇全部
fastcgi_pass php56:9000;
fastcgi_pass php:9000;