-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile.test
46 lines (39 loc) · 1.35 KB
/
Dockerfile.test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# 基础镜像
FROM python:3.11-bookworm
# 安装依赖,尝试通用方法安装linux-headers
# 注意:可能需要根据你的具体需求调整包名
RUN apt-get update && apt-get install -y --no-install-recommends \
tzdata \
git \
gcc \
build-essential \
libc-dev \
libjpeg-dev \
libffi-dev \
libxml2-dev \
libxslt-dev \
zlib1g-dev \
libyaml-dev \
&& apt-get install -y linux-headers-generic || apt-get install -y linux-headers-amd64 || apt-get install -y linux-headers-arm64 || apt-get install -y linux-headers-armhf \
&& rm -rf /var/lib/apt/lists/* \
&& cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone
# 克隆PixivBiu项目
RUN git clone --depth=1 https://github.com/txperl/PixivBiu.git /Pixiv \
&& cd /Pixiv \
&& rm -rf ./.git ./.github config.yml .gitattributes .gitignore LICENSE README.md README_EN.md
# 更新pip并安装Python依赖
RUN pip install --upgrade pip \
&& pip install -r /Pixiv/requirements.txt --no-cache-dir
# 清理不再需要的包
RUN apt-get purge -y --auto-remove \
-o APT::AutoRemove::RecommendsImportant=false \
tzdata git
# 暴露端口
EXPOSE 4001
# 设置环境变量
ENV sys.host="0.0.0.0:4001"
ENV sys.autoOpen=false
ENV sys.ignoreOutdated=true
# 定义入口点
ENTRYPOINT ["python","/Pixiv/main.py"]