Spaces:
Sleeping
Sleeping
| # Dockerfile | |
| # Dockerfile | |
| FROM python:3.10-slim | |
| ENV PIP_NO_CACHE_DIR=1 \ | |
| PYTHONDONTWRITEBYTECODE=1 \ | |
| PYTHONUNBUFFERED=1 \ | |
| HF_HOME=/app/cache \ | |
| XDG_CACHE_HOME=/app/cache \ | |
| HUGGINGFACE_HUB_CACHE=/app/cache/huggingface \ | |
| TRANSFORMERS_CACHE=/app/cache/huggingface \ | |
| TORCH_HOME=/app/cache/torch | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| build-essential git && rm -rf /var/lib/apt/lists/* | |
| WORKDIR /app | |
| COPY requirements.txt /app/ | |
| RUN pip install --upgrade pip && pip install -r requirements.txt | |
| # crea carpeta de cache con permisos amplios para el usuario que ejecute el contenedor | |
| RUN mkdir -p /app/cache && chmod -R 777 /app/cache | |
| COPY . /app | |
| # ¡ojo con el nombre del módulo! | |
| CMD sh -c 'uvicorn server1:app --host 0.0.0.0 --port ${PORT:-7860}' | |