Spaces:
Sleeping
Sleeping
| # Scelgo l'immagine di Python: | |
| FROM python:3.10-slim | |
| # Imposto la cartella di lavoro: | |
| WORKDIR /code | |
| # Copio il file requirements.txt per installare le dipendenze: | |
| COPY requirements.txt . | |
| # Installo le dipendenze: | |
| RUN pip install --no-cache-dir --upgrade -r requirements.txt | |
| # Copio tutto il codice nel contenitore: | |
| COPY . . | |
| # Uso porta 7860 che richiede HuggingFace: | |
| EXPOSE 7860 | |
| # Comando per il retraining: | |
| RUN python app/train.py | |
| # Per essere sicuri che python veda le cartelle: | |
| ENV PYTHONPATH=/code | |
| # Comando per avviare l'API: | |
| CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"] |