https://tommy.net.cn/2015/02/13/run-and ... er-part-1/
代碼: 選擇全部
hope_mysql:
container_name: hope_mysql
restart: always
image: mariadb:latest
ports:
- "3306:3306"
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
ports:
- "9000:9000"
links:
- hope_mysql:db
environment:
- DB_HOST=hope_mysql
volumes:
- ~/Sites:/var/www/html
hope_nginx:
container_name: hope_nginx
restart: always
image: local/nginx
ports:
- "80:80"
links:
- php:php
- php56:php56
volumes:
- ~/Sites:/var/www/html