下载镜像
docker pull tiangolo/uwsgi-nginx-flask:python3.6-index
启动container:
-v <host_path:container_path>
docker run -d --name flask_2 \
-p 80:80 \
-v /data/docker/flask_app:/app \
tiangolo/uwsgi-nginx-flask:python3.6-index
把container的app目录复制到host:
重新开一个container
docker run -d --name flask tiangolo/uwsgi-nginx-flask:python3.6-index
进入container
docker exec -it flask /bin/bash
复制文件到192.168.2.1
scp -r /app 192.168.2.180:/data/docker/flask_app/
访问web
app目录结构:
tree /data/docker/flask_app/
/data/docker/flask_app/
├── main.py
├── prestart.sh
├── static
└── index.html
└── uwsgi.in