Spaces:
Build error
Build error
| # --------------------------- | |
| # 1️⃣ Base image | |
| # --------------------------- | |
| FROM python:3.11-slim | |
| # --------------------------- | |
| # 2️⃣ Set working directory | |
| # --------------------------- | |
| WORKDIR /home/user/app | |
| # --------------------------- | |
| # 3️⃣ System dependencies | |
| # --------------------------- | |
| RUN apt-get update && apt-get install -y \ | |
| git \ | |
| git-lfs \ | |
| ffmpeg \ | |
| libsm6 \ | |
| libxext6 \ | |
| cmake \ | |
| rsync \ | |
| libgl1 \ | |
| curl \ | |
| && rm -rf /var/lib/apt/lists/* \ | |
| && git lfs install | |
| # --------------------------- | |
| # 4️⃣ Copy requirements | |
| # --------------------------- | |
| COPY requirements.txt /tmp/requirements.txt | |
| # --------------------------- | |
| # 5️⃣ Install Python dependencies (upgrade pip & clear cache) | |
| # --------------------------- | |
| RUN pip install --upgrade pip \ | |
| && pip cache purge \ | |
| && pip install --no-cache-dir -r /tmp/requirements.txt | |
| # --------------------------- | |
| # 6️⃣ Copy app code | |
| # --------------------------- | |
| COPY . /home/user/app | |
| # --------------------------- | |
| # 7️⃣ Set user (optional) | |
| # --------------------------- | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| # --------------------------- | |
| # 8️⃣ Default command | |
| # --------------------------- | |
| CMD ["python", "app.py"] | |