Spaces:
Runtime error
Runtime error
Download Dockerfile from Amitkasar/ai-api-testing: direct link, hf CLI and curl.
- Browser
- Download file 999 Bytes
-
https://huggingface.co/spaces/Amitkasar/ai-api-testing/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Amitkasar/ai-api-testing/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Amitkasar/ai-api-testing/resolve/main/Dockerfile
999 Bytes
| FROM python:3.11-slim | |
| # Set up environment variables | |
| ENV PYTHONUNBUFFERED=1 \ | |
| DEBIAN_FRONTEND=noninteractive | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| build-essential \ | |
| libpq-dev \ | |
| && rm -rf /var/lib/apt/lists/* | |
| WORKDIR /app | |
| # Create a non-root user with UID 1000 | |
| RUN useradd -m -u 1000 user && chown -R user:user /app | |
| # Switch to the non-root user | |
| USER user | |
| ENV PATH=/home/user/.local/bin:$PATH | |
| # Install dependencies in user space | |
| COPY --chown=user requirements.txt . | |
| RUN pip install --no-cache-dir --user -r requirements.txt | |
| # Copy project files with user ownership | |
| COPY --chown=user . . | |
| # Create upload directories inside the app workspace | |
| RUN mkdir -p backend/uploads/audio backend/uploads/video backend/uploads/documents backend/uploads/images backend/uploads/specs | |
| EXPOSE 7860 | |
| CMD ["gunicorn", "backend.main:app", "-w", "2", "-k", "uvicorn.workers.UvicornWorker", "--bind", "0.0.0.0:7860", "--timeout", "120"] | |