File tree Expand file tree Collapse file tree 3 files changed +39
-1
lines changed Expand file tree Collapse file tree 3 files changed +39
-1
lines changed Original file line number Diff line number Diff line change
1
+ README.md
Original file line number Diff line number Diff line change
1
+ # Align with the CI/CD YML
2
+ FROM python:2.7
3
+
4
+ # Setup workdir
5
+ WORKDIR /api-server
6
+
7
+ # Copy src files
8
+ COPY . .
9
+
10
+ # Install deps
11
+ RUN pip install -r requirements.txt
12
+
13
+ # Temporary hack until PR https://github.com/wuhan2020/api-server/pull/27 is merged
14
+ RUN mkdir -p /home/wuhan2020/wuhan2020
15
+
16
+ # Expose port 5000
17
+ EXPOSE 5000
18
+
19
+ # Start the server
20
+ ENTRYPOINT [ "bash" , "bootstrap" ]
Original file line number Diff line number Diff line change @@ -9,9 +9,26 @@ git clone https://github.com/wuhan2020/wuhan2020
9
9
pip install -r requirements.txt
10
10
bash bootstrap
11
11
```
12
- 然后就可以在` http://[your-ip]:9000/wuhan2020/[list_path] ` 调试api
12
+
13
+ 然后就可以在` http://your-ip:9000/wuhan2020/ ` 调试api
13
14
注意` list_path ` 是在` utils.py ` 中被` data.route ` 注册的path,
14
15
` your-ip ` 默认是127.0.0.1
16
+
17
+ ## Docker 容器运行
18
+ 需要安装[ Docker客户端] ( https://www.docker.com/products/docker-desktop ) .
19
+
20
+ ### Build Docker Image
21
+ 在本项目根目录下执行 ` docker build -t api-server:default . ` .
22
+ 注意国内这一步可能会耗时较长.
23
+
24
+ ### Run Docker Image
25
+ 执行 ` docker run --name api-server --publish 5000:5000 api-server:default ` 后可在本地浏览器中打开http://localhost:5000/wuhan2020/{endpoint} . (使用 ` -d ` 进入detach模式)
26
+
27
+ _ 如果出现 ` The container name "/api-server" is already in use ` 报错可先执行 ` docker rm api-server ` 删除残留的同名容器._
28
+
29
+ ### Stop Docker Container
30
+ 执行 ` docker stop api-server ` 停止运行中的容器.
31
+
15
32
## 项目文件说明
16
33
17
34
```
You can’t perform that action at this time.
0 commit comments