Spaces:
Runtime error
Runtime error
| FROM python:3.11-slim | |
| ENV PYTHONUNBUFFERED=1 \ | |
| PYTHONDONTWRITEBYTECODE=1 \ | |
| PIP_NO_CACHE_DIR=1 \ | |
| HF_HOME=/models/hf \ | |
| TRANSFORMERS_CACHE=/models/hf \ | |
| TORCH_HOME=/models/torch \ | |
| YOLO_CONFIG_DIR=/tmp/yolo \ | |
| MPLCONFIGDIR=/tmp/mpl | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| build-essential \ | |
| libgl1 \ | |
| libglib2.0-0 \ | |
| libpq-dev \ | |
| curl \ | |
| ca-certificates \ | |
| && rm -rf /var/lib/apt/lists/* | |
| WORKDIR /app | |
| COPY pyproject.toml ./ | |
| RUN pip install --upgrade pip \ | |
| && pip install --extra-index-url https://download.pytorch.org/whl/cpu -e . | |
| COPY alembic.ini ./ | |
| COPY app ./app | |
| COPY scripts ./scripts | |
| COPY tests ./tests | |
| RUN mkdir -p /models /seed_data | |
| # Hugging Face Spaces convention: listen on $PORT (defaults to 7860 there). | |
| # Locally, docker-compose.yml's `command:` overrides this to use port 8000. | |
| EXPOSE 7860 | |
| CMD ["bash", "-lc", "alembic upgrade head && uvicorn app.main:app --host 0.0.0.0 --port ${PORT:-7860}"] | |