Spaces:
Running
Running
Download Dockerfile from harsh-77/Autofilldropdown: direct link, hf CLI and curl.
- Browser
- Download file 1.2 kB
-
https://huggingface.co/spaces/harsh-77/Autofilldropdown/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/harsh-77/Autofilldropdown/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/harsh-77/Autofilldropdown/resolve/main/Dockerfile
1.2 kB
| # Use official Python 3.10 slim image | |
| FROM python:3.10-slim | |
| # Set environment variables | |
| # - PYTHONUNBUFFERED: Prevents Python from buffering stdout/stderr | |
| # - PYTHONDONTWRITEBYTECODE: Prevents Python from writing .pyc files | |
| # - HF_HOME: Specifies the directory where Hugging Face downloads and caches models | |
| ENV PYTHONUNBUFFERED=1 \ | |
| PYTHONDONTWRITEBYTECODE=1 \ | |
| HF_HOME=/app/model_cache \ | |
| PORT=8000 | |
| # Set the working directory inside the container | |
| WORKDIR /app | |
| # Install system dependencies | |
| # Note: ffmpeg is required by faster-whisper for handling audio uploads and conversions | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| ffmpeg \ | |
| build-essential \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy the requirements file to the container | |
| COPY requirements.txt . | |
| # Upgrade pip and install Python packages | |
| # This is cached by Docker unless requirements.txt changes | |
| RUN pip install --no-cache-dir --upgrade pip && \ | |
| pip install --no-cache-dir -r requirements.txt | |
| # Copy the application source code | |
| COPY . . | |
| # Expose the application port | |
| EXPOSE 8000 | |
| # Run the FastAPI server via Uvicorn | |
| CMD ["sh", "-c", "uvicorn main:app --host 0.0.0.0 --port ${PORT}"] | |