Download Dockerfile from Mohamed424/stroke-segmentation-backend: direct link, hf CLI and curl.
- Browser
- Download file 669 Bytes
-
https://huggingface.co/spaces/Mohamed424/stroke-segmentation-backend/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Mohamed424/stroke-segmentation-backend/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Mohamed424/stroke-segmentation-backend/resolve/main/Dockerfile
669 Bytes
| FROM python:3.11 | |
| WORKDIR /code | |
| # Copy requirements file first for better caching | |
| COPY requirements.txt /code/requirements.txt | |
| # Install dependencies | |
| RUN pip install --no-cache-dir -r /code/requirements.txt | |
| # Copy application code | |
| COPY app /code/app | |
| # Set proper permissions for app files | |
| RUN chmod -R 755 /code/app | |
| # Create directories for matplotlib to use | |
| RUN mkdir -p /tmp/matplotlib && chmod 777 /tmp/matplotlib | |
| # Ensure models directory exists and has proper permissions | |
| RUN mkdir -p /code/app/models && chmod 755 /code/app/models | |
| # Expose the port | |
| EXPOSE 7860 | |
| # Run the application | |
| CMD ["uvicorn", "app.server:app", "--host", "0.0.0.0", "--port", "7860"] |