Spaces:
Running
Running
File size: 720 Bytes
efa0205 616280d |
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 |
FROM python:3.10-slim
WORKDIR /app
# Create cache directory with proper permissions
RUN mkdir -p /.cache/huggingface && chmod 777 /.cache/huggingface
# 安装系统依赖
RUN apt-get update && apt-get install -y \
gcc \
g++ \
&& rm -rf /var/lib/apt/lists/*
# 复制项目文件
COPY requirements.txt .
COPY app.py .
COPY sha3_wasm_bg.7b9ca65ddd.wasm .
COPY templates/ templates/
# 安装Python依赖
RUN pip install --no-cache-dir -r requirements.txt
# 设置环境变量
ENV PYTHONUNBUFFERED=1
ENV HOST=0.0.0.0
ENV PORT=7860
ENV TRANSFORMERS_CACHE=/.cache/huggingface
# 设置权限
RUN chmod +x app.py
RUN chmod 755 sha3_wasm_bg.7b9ca65ddd.wasm
# 暴露端口
EXPOSE 7860
CMD ["python", "app.py"] |