Spaces:
Sleeping
Sleeping
Download Dockerfile from Vizxal/Cat-Rescue: direct link, hf CLI and curl.
- Browser
- Download file 2.88 kB
-
https://huggingface.co/spaces/Vizxal/Cat-Rescue/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Vizxal/Cat-Rescue/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Vizxal/Cat-Rescue/resolve/main/Dockerfile
2.88 kB
| # βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| # Cat Rescue OpenEnv β Dockerfile | |
| # Compatible with Hugging Face Spaces (port 7860 required) | |
| # | |
| # Build: docker build -t cat-rescue . | |
| # Run: docker run -p 7860:7860 cat-rescue | |
| # βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| # Use the official slim Python 3.12 image as the base | |
| FROM python:3.12-slim | |
| # ββ Metadata ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| LABEL maintainer="Cat Rescue Team" | |
| LABEL description="Cat Rescue OpenEnv β Meta Γ PyTorch Hackathon" | |
| # ββ System setup ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| # Set the working directory inside the container | |
| WORKDIR /app | |
| # Prevent Python from writing .pyc files and enable unbuffered stdout/stderr | |
| # (unbuffered output is important for real-time logs in HF Spaces) | |
| ENV PYTHONDONTWRITEBYTECODE=1 \ | |
| PYTHONUNBUFFERED=1 | |
| # ββ Install dependencies βββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| # Copy only requirements first so Docker can cache this layer | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir --upgrade pip \ | |
| && pip install --no-cache-dir -r requirements.txt | |
| # ββ Copy application code ββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| # Copy all project files into the container's working directory | |
| COPY environment.py . | |
| COPY rewards.py . | |
| COPY grader.py . | |
| COPY server.py . | |
| COPY index.html . | |
| # ββ Expose the port βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| # HuggingFace Spaces routes external traffic to port 7860 | |
| EXPOSE 7860 | |
| # ββ Launch command βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| # Start the FastAPI app via uvicorn on 0.0.0.0:7860 | |
| CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"] | |