Spaces:
Paused
Paused
Download Dockerfile from hengds2f/baseball-predictor: direct link, hf CLI and curl.
- Browser
- Download file 664 Bytes
-
https://huggingface.co/spaces/hengds2f/baseball-predictor/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/hengds2f/baseball-predictor/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/hengds2f/baseball-predictor/resolve/main/Dockerfile
664 Bytes
| FROM python:3.10 | |
| # 1. Create a standard, non-root user (Hugging Face requires this for security) | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV PATH="/home/user/.local/bin:$PATH" | |
| # 2. Set the working directory to the new user's home folder | |
| WORKDIR /home/user/app | |
| # THE FIX: Force the threads to be a valid integer | |
| ENV OMP_NUM_THREADS="2" | |
| # 3. Copy requirements and give ownership to the new user | |
| COPY --chown=user ./requirements.txt requirements.txt | |
| RUN pip install --no-cache-dir --upgrade -r requirements.txt | |
| # 4. Copy the rest of your code and model | |
| COPY --chown=user . . | |
| # 5. Start the server | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] |