Skip to content

Commit

Permalink
Create Docker Image
Browse files Browse the repository at this point in the history
  • Loading branch information
yousiki committed Sep 9, 2019
1 parent 0edb751 commit 55bb218
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 0 deletions.
41 changes: 41 additions & 0 deletions DOCKER.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# PKUAutoElective Docker Image

依赖于原项目v2.0.2(2019.09.09)版本。

## Tags

1. latest
2. monitor

## latest

包含python3,依赖库,以及项目源代码。

### 运行方法

``` bash
docker run -d \
--name=pae \
-v /path/to/config/folder:/config \
yousiki/pkuautoelective:latest # 运行工具
docker logs pae # 查看输出
docker stop pae # 停止工具
```

## monitor

额外包含Monitor运行依赖的库。

### 运行方法

`config.ini`中的`host`值建议设为`0.0.0.0`

``` bash
docker run -d \
--name=pae \
-p 7074:7074 \
-v /path/to/config/folder:/config \
yousiki/pkuautoelective:latest # 运行工具
docker logs pae # 查看输出
docker stop pae # 停止工具
```
26 changes: 26 additions & 0 deletions Docker/latest.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM python:slim

LABEL maintainer="[email protected]"

RUN pip install --no-cache-dir \
-i https://pypi.tuna.tsinghua.edu.cn/simple \
lxml \
numpy \
Pillow \
sklearn \
requests \
simplejson

ADD . /workspace

VOLUME [ "/config" ]

WORKDIR /workspace

CMD [ \
"python", \
"main.py", \
"--with-monitor", \
"--config=/config/config.ini", \
"--course-csv-gbk=/config/course.gbk.csv", \
"--course-csv-utf8=/config/course.utf-8.csv" ]
31 changes: 31 additions & 0 deletions Docker/monitor.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM python:slim

LABEL maintainer="[email protected]"

RUN pip install --no-cache-dir \
-i https://pypi.tuna.tsinghua.edu.cn/simple \
lxml \
numpy \
Pillow \
sklearn \
requests \
simplejson

RUN pip install --no-cache-dir \
-i https://pypi.tuna.tsinghua.edu.cn/simple \
flask \
werkzeug

ADD . /workspace

VOLUME [ "/config" ]

WORKDIR /workspace

CMD [ \
"python", \
"main.py", \
"--with-monitor", \
"--config=/config/config.ini", \
"--course-csv-gbk=/config/course.gbk.csv", \
"--course-csv-utf8=/config/course.utf-8.csv" ]

0 comments on commit 55bb218

Please sign in to comment.