Download Dockerfile from tusarway/codegen: direct link, hf CLI and curl.
- Browser
- Download file 734 Bytes
-
https://huggingface.co/spaces/tusarway/codegen/resolve/730ed04c53d9295e06cafa57321d49d1fdef3639/Dockerfile
- Command line
-
hf download hf://spaces/tusarway/codegen@730ed04c53d9295e06cafa57321d49d1fdef3639/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/tusarway/codegen/resolve/730ed04c53d9295e06cafa57321d49d1fdef3639/Dockerfile
734 Bytes
| FROM python:3.11-slim | |
| WORKDIR /app | |
| # System build deps for llama-cpp-python (CPU + OpenBLAS for speed) | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| cmake \ | |
| libopenblas-dev \ | |
| curl \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Install Python deps — compile llama-cpp-python with OpenBLAS | |
| COPY requirements.txt . | |
| RUN CMAKE_ARGS="-DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS" \ | |
| FORCE_CMAKE=1 \ | |
| pip install --no-cache-dir -r requirements.txt | |
| COPY app.py . | |
| # HuggingFace Spaces expects port 7860 | |
| EXPOSE 7860 | |
| # Set SPACE_URL at runtime via HF Space secrets/env vars | |
| ENV SPACE_URL="" | |
| ENV N_CTX="8192" | |
| ENV N_THREADS="2" | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"] |