| |
|
|
| |
| FROM python:3.11-slim |
| |
| ENV FORCE_REBUILD=2025-08-22-17h12 |
|
|
| |
| |
| RUN apt-get update \ |
| && apt-get install -y --no-install-recommends \ |
| ffmpeg \ |
| libglib2.0-0 \ |
| libgomp1 \ |
| libgl1 \ |
| wget \ |
| git \ |
| unzip \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| WORKDIR /app |
|
|
| |
| ENV HF_HOME=/home/user/.cache/huggingface |
| ENV TRANSFORMERS_CACHE=/home/user/.cache/huggingface/transformers |
| ENV HUGGINGFACE_HUB_CACHE=/home/user/.cache/huggingface |
|
|
| |
| COPY requirements.txt /app/requirements.txt |
| RUN pip install --no-cache-dir --upgrade pip \ |
| && pip install --no-cache-dir -r /app/requirements.txt |
|
|
| |
| RUN useradd -m -u 1000 user \ |
| && mkdir -p /app/data/_thumbs /app/data/_masks \ |
| && chown -R user:user /app |
| USER user |
| ENV PATH="/home/user/.local/bin:${PATH}" |
|
|
| |
| COPY --chown=user:user . /app |
|
|
| |
| ENV PORT=7860 |
| EXPOSE 7860 |
| CMD ["bash","-lc","uvicorn app:app --host 0.0.0.0 --port ${PORT}"] |
|
|