Spaces:
Runtime error
Runtime error
Download Dockerfile from Cryped-Official/smart-proxy-system: direct link, hf CLI and curl.
- Browser
- Download file 1.02 kB
-
https://huggingface.co/spaces/Cryped-Official/smart-proxy-system/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Cryped-Official/smart-proxy-system/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Cryped-Official/smart-proxy-system/resolve/main/Dockerfile
1.02 kB
| # Use an official lightweight Python image | |
| FROM python:3.11-slim | |
| # Set environment variables | |
| # Prevents Python from writing pyc files to disc | |
| ENV PYTHONDONTWRITEBYTECODE=1 | |
| # Prevents Python from buffering stdout and stderr (helps with logging) | |
| ENV PYTHONUNBUFFERED=1 | |
| # Set the working directory inside the container | |
| WORKDIR /app | |
| # Upgrade pip to the latest version | |
| RUN pip install --upgrade pip | |
| # Copy only the requirements file first to leverage Docker cache | |
| # (If requirements.txt doesn't change, Docker won't reinstall dependencies) | |
| COPY requirements.txt . | |
| # Install Python dependencies | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy the rest of the application code | |
| COPY app.py . | |
| # Expose the port Hugging Face Spaces expects (7860) | |
| EXPOSE 7860 | |
| # Define default environment variables (you will override these at runtime/deployment) | |
| ENV HF_TOKEN="" | |
| ENV HF_DATASET_REPO="" | |
| # Command to run the FastAPI application using uvicorn | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |