Spaces:
Sleeping
Sleeping
Download Dockerfile from microlab-chalmers/microvision-model: direct link, hf CLI and curl.
- Browser
- Download file 894 Bytes
-
https://huggingface.co/spaces/microlab-chalmers/microvision-model/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/microlab-chalmers/microvision-model/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/microlab-chalmers/microvision-model/resolve/main/Dockerfile
894 Bytes
| FROM python:3.12-slim | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| git \ | |
| build-essential \ | |
| cmake \ | |
| libgl1 \ | |
| libglib2.0-0 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Install uv from the official image | |
| COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ | |
| WORKDIR /app | |
| # Copy dependency files | |
| COPY pyproject.toml uv.lock ./ | |
| # Install core dependencies first | |
| # We force install torch separately to ensure it is present for detectron2's build | |
| RUN uv sync --frozen --no-dev | |
| # Install detectron2 | |
| # Note: --no-build-isolation is often required for detectron2 to find | |
| # the torch installed by uv | |
| # RUN .venv/bin/pip install 'git+https://github.com/facebookresearch/detectron2.git' --no-build-isolation | |
| # Copy the rest of your application code | |
| COPY . . | |
| # Set environment | |
| ENV PATH="/app/.venv/bin:$PATH" | |
| # Run the application | |
| CMD ["python", "app.py"] |