File size: 854 Bytes
eb40ae9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
47
48
49
FROM python:3.10

# 安装系统依赖
RUN apt-get update && apt-get install -y \
    git \
    cmake \
    build-essential \
    zlib1g-dev \
    libaio-dev \
    pkg-config \
    && rm -rf /var/lib/apt/lists/*

RUN pip install -U --no-cache-dir \
    cmake==4.0.3 \
    pybind11==2.13.6 \
    spacy==3.5.0 \
    torch==1.13.1

# 复制依赖文件
COPY requirements.txt .

# 安装 Python 依赖
RUN pip install -r requirements.txt

RUN pip install -U --no-cache-dir \
    numpy==1.24.1

# 下载 spaCy 模型
RUN python -m spacy download en_core_web_sm

# 安装 ffrecord 库
RUN pip install git+https://github.com/HFAiLab/ffrecord.git

# 设置工作目录
WORKDIR /app

# 复制应用文件
COPY . .

# 复制应用代码
COPY . .

ENV PYTHONPATH=/app
ENV GRADIO_SERVER_NAME=0.0.0.0
ENV GRADIO_SERVER_PORT=7860

EXPOSE 7860

CMD ["python", "app.py"]