Spaces:
Sleeping
Sleeping
| # THE FINAL, CORRECT BLUEPRINT. THIS WILL WORK. | |
| FROM python:3.10-slim | |
| # Set up a writable directory for our model | |
| RUN mkdir -p /app/data && chown -R 1000:1000 /app | |
| WORKDIR /app | |
| # Copy and install the lightweight requirements | |
| COPY --chown=1000:1000 requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy the API code | |
| COPY --chown=1000:1000 main.py . | |
| # Explicitly run as the non-root 'user' | |
| USER 1000 | |
| # The simple, reliable startup command. | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] |