docker_test.zip version: '2.0'

services:
nginx:

restart: always
image: nginx:1.11.6-alpine
depends_on:
  - "php"
ports:
  - 9090:80
volumes:
  - $PWD/conf.d:/etc/nginx/conf.d
  - $PWD/log:/var/log/nginx
  - $PWD/html:/html
networks:
  - "webnet"
container_name: "compose-nginx"

php:
image: php:7.1-fpm
expose:

  - "9000"

volumes:

 - $PWD/html:/html
 - $PWD/php/www.conf:/usr/local/etc/php-fpm.d/www.conf

networks:

 - "webnet"

container_name: "compose-php"
# mysql:
# image: mysql:5.7
# ports:
# - "3307:3306"
# # 环境变量
# environment:
# # mysql密码
# - MYSQL_ROOT_PASSWORD=1234567
# networks:
# - "webnet"
# container_name: "compose-mysql"
networks:
webnet:

driver: bridge
最后修改:2019 年 03 月 27 日 06 : 43 PM
如果觉得我的文章对你有用,请随意赞赏