Spaces:
Running
Running
File size: 937 Bytes
e58615a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | # Hugging Face Space (sdk: docker). Escucha en 7860.
FROM python:3.11-slim
ENV PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
RACING_REPORTS_CACHE_DIR=/tmp/rr-cache \
RACING_REPORTS_OUTPUT_DIR=/tmp/rr-out \
HF_HOME=/tmp/hf \
MPLCONFIGDIR=/tmp/mpl
# libgomp1 lo necesitan torch/lightgbm; el resto vienen como wheels.
RUN apt-get update && apt-get install -y --no-install-recommends \
libgomp1 && rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Torch CPU primero (evita bajar el build CUDA gigante).
RUN pip install --no-cache-dir torch>=2.2.0 --index-url https://download.pytorch.org/whl/cpu
COPY pyproject.toml README.md ./
COPY src ./src
COPY vendor ./vendor
RUN pip install --no-cache-dir -e .
# Cache/outputs en disco efímero del Space (escribible).
RUN mkdir -p /tmp/rr-cache /tmp/rr-out /tmp/mpl && chmod -R 777 /tmp/rr-cache /tmp/rr-out /tmp/mpl
EXPOSE 7860
CMD ["python", "-m", "racing_reports.web.app"]
|