Spaces:
Running
Running
Changes made in requirements.txt, dockerfile and main.py to handle twilio websocket connection
6ee9d08 Download Dockerfile from Arnavkumar01/AI_Calling_Agent: direct link, hf CLI and curl.
- Browser
- Download file 914 Bytes
-
https://huggingface.co/spaces/Arnavkumar01/AI_Calling_Agent/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Arnavkumar01/AI_Calling_Agent/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Arnavkumar01/AI_Calling_Agent/resolve/main/Dockerfile
914 Bytes
| # 1. Start with a lean and official Python base image | |
| FROM python:3.10-slim | |
| # Install dependencies for psycopg2 and audio processing | |
| RUN apt-get update && apt-get install -y libpq-dev ffmpeg && rm -rf /var/lib/apt/lists/* | |
| # 2. Set the working directory inside the container | |
| WORKDIR /app | |
| # 3. Create a non-root user and set up cache | |
| RUN useradd -m -u 1000 user | |
| RUN mkdir -p /app/.cache && chown -R user:user /app/.cache | |
| ENV HF_HOME="/app/.cache" | |
| USER user | |
| # Add local bin directory to PATH | |
| ENV PATH="/home/user/.local/bin:${PATH}" | |
| # 4. Copy and install dependencies | |
| COPY --chown=user:user requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # 5. Copy the app source code | |
| COPY --chown=user:user . . | |
| # 6. Expose the port used by Hugging Face Spaces | |
| EXPOSE 7860 | |
| # 7. Run the FastAPI app using Uvicorn (better for WebSockets) | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] | |