26 lines
596 B
Docker
26 lines
596 B
Docker
FROM python:3.11-slim
|
||
|
||
WORKDIR /app
|
||
|
||
# 1. 安装系统编译依赖(qqwry-py3 需要编译)
|
||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||
build-essential \
|
||
libffi-dev \
|
||
libssl-dev \
|
||
python3-dev \
|
||
&& rm -rf /var/lib/apt/lists/*
|
||
|
||
# 2. 复制并安装 Python 依赖
|
||
COPY requirements.txt .
|
||
RUN pip install --no-cache-dir -r requirements.txt
|
||
|
||
# 3. 复制源码 & 纯真库
|
||
COPY qqwry.dat app.py ./
|
||
|
||
# 4. 默认端口 5000,可 docker run -e PORT=8080 覆盖
|
||
ENV PORT=5000
|
||
EXPOSE ${PORT}
|
||
|
||
# 5. 直接 python 启动
|
||
CMD ["python", "app.py"]
|