[U] dockerize

pull/35/head
Hykilpikonna 2022-12-03 02:37:04 -05:00
parent 8f826c393e
commit 989f307e52
No known key found for this signature in database
GPG Key ID: 256CD01A41D7FA26
4 changed files with 21 additions and 4 deletions

12
Dockerfile Normal file
View File

@ -0,0 +1,12 @@
FROM python:3.11-alpine
WORKDIR /app
COPY requirements.txt /app
# Since alpine doesn't have stable opencc yet, we need to add its testing repo.
# The opencc binary in the testing repo didn't include a libopencc.so.1 file but did include libopencc.so.1.1,
# So linking is necessary
RUN pip install -r requirements.txt \
&& echo "@testing https://dl-cdn.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
&& apk add --no-cache opencc@testing git \
&& ln -s $(find / -name "libopencc.so.1*" -print -quit) /usr/lib/libopencc.so.1 \

View File

@ -25,8 +25,6 @@
更新简体文稿之后请手动执行一个脚本生成繁体文稿。(因为 Github Actions 奇怪的问题太多了,还好难测试,还是换成本地构建啦)
构建环境需要 python >= 3.7,可以执行 `pip install -r requirements.txt` 来安装依赖。
然后运行 `./scripts/convert_zh.py` 就可以更新繁体了!
构建环境需要安装 docker, 然后 `docker-compose up` 就可以更新繁体了!
这个脚本不会覆盖在已有的繁体文件上的更改,更新已经生成过繁体的简体文稿之后会自动合并,不过还是要手动检查一下哦。

7
docker-compose.yml Normal file
View File

@ -0,0 +1,7 @@
services:
convert:
container_name: oau-convert
build: .
volumes:
- ".:/app"
entrypoint: "./scripts/convert_zh.py"

View File

@ -1 +1 @@
dacf47e2d848513235bda0af91c15e1b18e7cc97
8f826c393e75c64e393b74ccdca67330c6462e4e