Spaces:
Running
Running
FROM python:3.10-slim | |
RUN apt-get update && apt-get install -y \ | |
git ffmpeg curl build-essential \ | |
&& apt-get clean && rm -rf /var/lib/apt/lists/* | |
WORKDIR /app | |
# Create writable cache directories | |
RUN mkdir -p /app/hf_cache/hub \ | |
&& mkdir -p /app/hf_cache/xet \ | |
&& mkdir -p /app/hf_cache/assets | |
# Set environment variables BEFORE installing libs | |
ENV HF_HOME=/app/hf_cache | |
ENV HF_HUB_CACHE=/app/hf_cache/hub | |
ENV HF_XET_CACHE=/app/hf_cache/xet | |
ENV HF_ASSETS_CACHE=/app/hf_cache/assets | |
COPY requirements.txt . | |
RUN pip install --no-cache-dir -r requirements.txt | |
COPY . . | |
# Expose port for web apps (Flask/Gradio/etc.) | |
EXPOSE 7860 | |
CMD ["python", "main.py"] | |