修改 docker-compose 使用说明

This commit is contained in:
Jalin
2019-01-22 11:58:26 +08:00
parent 89c7e2b0f9
commit 8b90194f65
4 changed files with 20 additions and 15 deletions

3
.gitignore vendored
View File

@@ -4,4 +4,5 @@ venv
__pycache__
env.py
env.slave.py
env.docker.py
env.docker.py
docker-compose.yml

View File

@@ -100,14 +100,14 @@ docker run --rm --name py12306 -p 8008:8008 -d -v $(pwd):/config -v py12306:/dat
```
当前目录会多一个 12306.log 的日志文件, `tail -f 12306.log`
## Docker-compose 使用
**1. 在py12306目录下创建config目录**
```mkdir config```
### Docker-compose 使用
**1. 复制配置文件**
```
cp docker-compose.yml.example docker-compose.yml
```
**2. 修改配置文件**
在`config`目录下,根据自己的个人配置创建`env.py`文件
**2. 从 docker-compose 运行**
**3. 运行docker程序**
`docker-compose.yml`所在的目录使用命令
```
docker-compose up -d

View File

@@ -1,8 +0,0 @@
version: "2"
services:
go_home:
build: .
volumes:
- ./config:/config
ports:
- 18008:8008

View File

@@ -0,0 +1,12 @@
version: "2"
services:
py12306:
build: .
volumes:
- ./env.py:/config/env.py
- py12306:/data
ports:
- 8008:8008
volumes:
py12306: