cacode commited on
Commit
d969076
·
verified ·
1 Parent(s): 9d6ee7f

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +29 -11
Dockerfile CHANGED
@@ -1,17 +1,35 @@
1
- FROM debian:stable-slim
 
2
 
3
- RUN apt update && \
4
- apt install -y python3 python3-pip && \
5
- pip3 install --no-cache-dir --break-system-packages \
6
- setuptools==69.0.3 \
7
- jaraco.collections \
8
- jaraco.text \
9
- jaraco.functools
10
 
11
- COPY aigc-bypasser /app
 
 
 
 
12
 
13
- RUN chmod +x /app
 
14
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  EXPOSE 8000
16
 
17
- CMD ["/app"]
 
 
1
+ # 选 python:3.10-slim 避开 PEP-668 并内置 pip
2
+ FROM python:3.10-slim
3
 
4
+ WORKDIR /app
 
 
 
 
 
 
5
 
6
+ # 安装最小系统依赖(ca-certificates 可让 TLS 正常工作)
7
+ RUN apt-get update \
8
+ && apt-get install -y --no-install-recommends \
9
+ ca-certificates \
10
+ && rm -rf /var/lib/apt/lists/*
11
 
12
+ # 将你本地的 .env 一并复制到容器(如果不想放在仓库,请在 Space 设置 Secrets)
13
+ COPY .env /app/.env
14
 
15
+ # 复制二进制到 /app/app 并赋予可执行权限
16
+ # 请把 BypassAIGC_linux 换成你的实际文件名(确保是 Linux x86_64 二进制)
17
+ COPY aigc-bypasser /app/app
18
+ RUN chmod +x /app/app
19
+
20
+ # 安装 setuptools + jaraco 系列到系统 site-packages,使 PyInstaller exe 能 import 到
21
+ RUN pip install --no-cache-dir \
22
+ setuptools \
23
+ jaraco.functools \
24
+ jaraco.text \
25
+ jaraco.collections
26
+
27
+ # 复制 entrypoint 脚本
28
+ COPY entrypoint.sh /app/entrypoint.sh
29
+ RUN chmod +x /app/entrypoint.sh
30
+
31
+ ENV PORT=8000
32
  EXPOSE 8000
33
 
34
+ # 通过 entrypoint 先确保 .env 加载、db 存在,然后执行二进制
35
+ CMD ["/app/entrypoint.sh"]