Spaces:
Sleeping
Sleeping
Download DockerFile from CodeCommunity/gitgud-ai: direct link, hf CLI and curl.
- Browser
- Download file 905 Bytes
-
https://huggingface.co/spaces/CodeCommunity/gitgud-ai/resolve/174a4e2ca88bc21eb59fde93f8a2e113e9d8899c/DockerFile
- Command line
-
hf download hf://spaces/CodeCommunity/gitgud-ai@174a4e2ca88bc21eb59fde93f8a2e113e9d8899c/DockerFile
-
curl -L -o DockerFile https://huggingface.co/spaces/CodeCommunity/gitgud-ai/resolve/174a4e2ca88bc21eb59fde93f8a2e113e9d8899c/DockerFile
905 Bytes
| # Use a lightweight Python image | |
| FROM python:3.10-slim | |
| # Set working directory | |
| WORKDIR /code | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy requirements and install | |
| COPY ./requirements.txt /code/requirements.txt | |
| RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt | |
| # Create a non-root user (Hugging Face requirement) | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH | |
| # Copy the rest of the app | |
| WORKDIR $HOME/app | |
| COPY --chown=user . $HOME/app | |
| # Ensure the transformers cache is in a writable directory | |
| ENV HF_HOME=/home/user/app/.cache | |
| RUN mkdir -p /home/user/app/.cache && chmod 777 /home/user/app/.cache | |
| # Expose port 7860 (Hugging Face default) | |
| CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"] |