v9n_withfront / Dockerfile
sonia2025's picture
Update Dockerfile
5972109 verified
raw
history blame contribute delete
618 Bytes
FROM python:3.12-slim
# 安装 OpenCV 依赖
RUN apt-get update && apt-get install -y --no-install-recommends \
libgl1-mesa-glx libglib2.0-0 libsm6 libxrender1 libxext6 \
&& rm -rf /var/lib/apt/lists/*
# 把 HF 缓存改到 /tmp,可写
ENV HF_HOME=/tmp/.cache/huggingface
ENV XDG_CACHE_HOME=/tmp/.cache
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
# ➊ 预先创建目录、并设为所有用户可写
RUN mkdir -p uploads outputs \
&& chmod -R 777 uploads outputs
ENV PORT=7860
EXPOSE 7860
CMD gunicorn app:app --bind 0.0.0.0:$PORT --workers 1