dddeepseek / Dockerfile
coo7's picture
Upload 3 files
616280d verified
raw
history blame
814 Bytes
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 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/hub
ENV HF_HOME=/.cache/huggingface
# 设置权限
RUN chmod +x app.py
# 暴露端口
EXPOSE 7860
# 修改缓存目录权限
RUN mkdir -p /.cache/huggingface/hub && chmod -R 777 /.cache/huggingface
CMD ["python", "app.py"]