使用docker-compose创建多项目容器运行
- 按招网友提供方法创建
- docker-compose.yml内容(这里改了桥接模式,并且注释放开)
version: "3"
services:
docker_python:
image: python:2.7.18
container_name: py_app
working_dir: "/root"
restart: always
volumes:
- "/root/docker_python/demo:/root/demo"
networks:
- py_net
environment:
- TZ=Asia/Shanghai
stdin_open: true
tty: true
networks:
py_net:
driver: bridge