Download Dockerfile from AhsanAftab/damage-segmentation-api: direct link, hf CLI and curl.
- Browser
- Download file 590 Bytes
-
https://huggingface.co/spaces/AhsanAftab/damage-segmentation-api/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/AhsanAftab/damage-segmentation-api/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/AhsanAftab/damage-segmentation-api/resolve/main/Dockerfile
590 Bytes
| # Use official Python image | |
| FROM python:3.9 | |
| # Set working directory | |
| WORKDIR /code | |
| # Copy requirements and install dependencies | |
| # Note: We use the CPU version of PyTorch to keep the image small | |
| COPY ./requirements.txt /code/requirements.txt | |
| RUN pip install --no-cache-dir --upgrade pip | |
| RUN pip install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cpu | |
| RUN pip install --no-cache-dir -r /code/requirements.txt | |
| # Copy the rest of the files | |
| COPY . . | |
| # Grant permissions (sometimes needed for HF) | |
| RUN chmod -R 777 /code | |
| # Run the app | |
| CMD ["python", "app.py"] |