Merge pull request #234 from SayNothingToday/master

增加简单的docker支持
This commit is contained in:
Yoshiko2
2020-05-04 16:41:11 +08:00
committed by GitHub
4 changed files with 65 additions and 0 deletions

View File

@@ -93,6 +93,15 @@ CLI 版本
3. 运行软件等待完成 3. 运行软件等待完成
4. 把 JAV_output 导入至 Kodi, Emby, Jellyfin 中。 4. 把 JAV_output 导入至 Kodi, Emby, Jellyfin 中。
## 使用 Docker
Docker容器可以方便在在NAS上使用。
1. 将docker目录中的内容下载下来
2. 构建镜像 `sudo docker-compose build jav`
3. 运行容器 `JAVUID=$(id -u) JAVGID=$(id -g) JAV_PATH=<FullPathToLibrary> sudo docker up -d jav`
4. 容器运行结束后会自动退出,处理好的内容会存入`<FullPathToLibrary>/organized`, 失败的内容会移入`<FullPathToLibrary>/failure_output`.
5. 注意目前容器不支持配置代理。所以必须在路由器上配置好透明代理或者在build之前自行修改`config.ini`的内容。
详细请看以下完整文档 详细请看以下完整文档
# 完整文档 # 完整文档

16
docker/Dockerfile Normal file
View File

@@ -0,0 +1,16 @@
FROM python:slim
RUN sed -i 's/deb.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list \
&& sed -i 's/security.debian.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apt/sources.list
RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pip -U \
&& pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
RUN apt-get update \
&& apt-get install -y wget ca-certificates \
&& wget -O - 'https://github.com/yoshiko2/AV_Data_Capture/archive/master.tar.gz' | tar xz \
&& mv AV_Data_Capture-master /jav \
&& cd /jav \
&& ( pip install --no-cache-dir -r requirements.txt || true ) \
&& pip install --no-cache-dir requests pyquery lxml Beautifulsoup4 pillow \
&& apt-get purge -y wget
WORKDIR /jav

27
docker/config.ini Normal file
View File

@@ -0,0 +1,27 @@
[common]
main_mode=1
failed_output_folder=data/failure_output
success_output_folder=data/organized
soft_link=0
[proxy]
proxy=
timeout=10
retry=3
[Name_Rule]
location_rule=actor+'/'+number
naming_rule=number+'-'+title
[update]
update_check=0
[escape]
literals=\()/
folders=data/failure_output,data/organized
[debug_mode]
switch=0
[media]
media_warehouse=plex

View File

@@ -0,0 +1,13 @@
version: "2.2"
services:
jav:
user: "${JAVUID}:${JAVGID}"
image: jav:local
build: .
volumes:
- ./config.ini:/jav/config.ini
- ${JAV_PATH}:/jav/data
command:
- python
- /jav/AV_Data_Capture.py
- -a