Spaces:
Sleeping
Sleeping
| FROM python:3.11-slim | |
| WORKDIR /app | |
| # Install deps as root so the console scripts (uvicorn) land on PATH | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy app code | |
| COPY . . | |
| # Create non-root user and switch (safer runtime) | |
| RUN useradd -m user && chown -R user:user /app | |
| USER user | |
| # App config | |
| ENV OUT_DIR=/app/out | |
| RUN mkdir -p $OUT_DIR | |
| EXPOSE 7860 | |
| # Use python -m to avoid PATH issues for uvicorn entrypoint | |
| CMD ["python", "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] | |