Spaces:
Sleeping
Sleeping
Download Dockerfile from riki74/OCR_YOLO_fastapi: direct link, hf CLI and curl.
- Browser
- Download file 1.01 kB
-
https://huggingface.co/spaces/riki74/OCR_YOLO_fastapi/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/riki74/OCR_YOLO_fastapi/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/riki74/OCR_YOLO_fastapi/resolve/main/Dockerfile
1.01 kB
| FROM python:3.9-slim | |
| # Imposta la working directory | |
| WORKDIR /app | |
| # Installa le librerie di sistema necessarie | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| libglib2.0-0 \ | |
| libgl1-mesa-glx \ | |
| libsm6 \ | |
| libxext6 \ | |
| libxrender-dev \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Crea le directory necessarie e ne modifica i permessi per renderle scrivibili | |
| RUN mkdir -p /tmp/.cache/hub /tmp/matplotlib /tmp/Ultralytics \ | |
| && chmod -R 777 /tmp/.cache /tmp/matplotlib /tmp/Ultralytics | |
| # Imposta le variabili d'ambiente per indirizzare le cache e configurazioni verso le directory scrivibili | |
| ENV HF_HOME=/tmp/.cache | |
| ENV MPLCONFIGDIR=/tmp/matplotlib | |
| ENV YOLO_CONFIG_DIR=/tmp/Ultralytics | |
| # Copia il file requirements.txt ed installa le dipendenze | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copia il codice dell'applicazione | |
| COPY . . | |
| # Espone la porta su cui gira l'API (7860) | |
| EXPOSE 7860 | |
| # Comando per avviare l'applicazione | |
| CMD ["python", "app.py"] | |