docker-compose 配置 容器 访问本地网络
创建一个外部网络sudo docker network create outside配置如下:version: '3.3'services:php:build: ./docker/phpworking_dir: /datavolumes:- .:/data- ./docker/php-fpm.conf:/usr/local/...
·
创建一个外部网络
docker network create outside
配置如下:
version: '3.3'
services:
php:
build: ./docker/php
working_dir: /data
volumes:
- .:/data
- ./docker/php-fpm.conf:/usr/local/etc/php-fpm.d/www.conf:ro
networks:
- default
- outside
nginx:
image: nginx
volumes:
- .:/data
- ./docker/nginx.conf:/etc/nginx/nginx.conf:ro
ports:
- 80:80
networks:
- default
command: [nginx, '-g', 'daemon off;']
networks:
outside:
external: true
更多推荐
已为社区贡献2条内容
所有评论(0)