Spaces:
Sleeping
Sleeping
Download Dockerfile from RaxoM21/MIR_Group07: direct link, hf CLI and curl.
- Browser
- Download file 1.8 kB
-
https://huggingface.co/spaces/RaxoM21/MIR_Group07/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/RaxoM21/MIR_Group07/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/RaxoM21/MIR_Group07/resolve/main/Dockerfile
1.8 kB
| # βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| # Group 07 β I-ILIA-014 MIR Project β’ Dockerfile (HF Spaces) | |
| # | |
| # Architecture: | |
| # β’ Data decoupled from Space repo: downloaded from separate Dataset repo | |
| # β’ Archives extracted at build time into /home/user/app/ | |
| # β’ Port 7860 (HF Spaces default) | |
| # β’ UID 1000 user "user" (HF Spaces convention) | |
| # β’ Layer caching: data layer cached across code-only rebuilds | |
| # βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ | |
| FROM python:3.11-slim | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| build-essential && rm -rf /var/lib/apt/lists/* | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV PATH="/home/user/.local/bin:$PATH" | |
| WORKDIR /home/user/app | |
| # Layer 1: install huggingface_hub to run the download script | |
| RUN pip install --no-cache-dir --upgrade pip && \ | |
| pip install --no-cache-dir "huggingface_hub>=0.23" | |
| # Layer 2: download and extract data β cached across code-only rebuilds | |
| COPY --chown=user download_data.py . | |
| RUN python download_data.py | |
| # Layer 3: install app dependencies | |
| COPY --chown=user requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Layer 4: copy app code β only this layer rebuilds on code changes | |
| COPY --chown=user . . | |
| ENV MIR_H5_DIR=/home/user/app/descriptors/CLIP_Flickr8k \ | |
| MIR_MAX_BACKBONES=4 \ | |
| MIR_DEFAULT_BACKBONE=clip | |
| EXPOSE 7860 | |
| CMD ["gunicorn", "--chdir", "/home/user/app/Interface", "-w", "1", "-b", "0.0.0.0:7860", "--timeout", "300", "app:app"] |