Spaces:
Running
Running
Download api/Dockerfile from JeanProjets/projet-8-api: direct link, hf CLI and curl.
- Browser
- Download file 560 Bytes
-
https://huggingface.co/spaces/JeanProjets/projet-8-api/resolve/main/api/Dockerfile
- Command line
-
hf download hf://spaces/JeanProjets/projet-8-api/api/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/JeanProjets/projet-8-api/resolve/main/api/Dockerfile
560 Bytes
| FROM python:3.12-slim | |
| ENV PYTHONDONTWRITEBYTECODE=1 \ | |
| PYTHONUNBUFFERED=1 | |
| WORKDIR /app | |
| COPY api/requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| COPY api/ api/ | |
| COPY models/unet_mobilenet.keras models/ | |
| # Le port est lu dans la variable PORT : Cloud Run la fixe lui-même (8080), | |
| # Hugging Face Spaces attend 7860 (valeur par défaut ici). | |
| ENV PORT=7860 | |
| EXPOSE 7860 | |
| # exec : uvicorn devient le processus principal et reçoit le signal d'arrêt du conteneur | |
| CMD ["sh", "-c", "exec uvicorn api.main:app --host 0.0.0.0 --port ${PORT}"] | |