Spaces:
Sleeping
Sleeping
| # Simple Dockerfile for HF Spaces deployment | |
| # Uses standard Python base instead of openenv-base to avoid startup hangs | |
| FROM python:3.11-slim | |
| WORKDIR /app | |
| # Install system dependencies | |
| RUN apt-get update && \ | |
| apt-get install -y --no-install-recommends curl git && \ | |
| rm -rf /var/lib/apt/lists/* | |
| # Install uv for fast dependency management | |
| RUN curl -LsSf https://astral.sh/uv/install.sh | sh && \ | |
| mv /root/.local/bin/uv /usr/local/bin/uv && \ | |
| mv /root/.local/bin/uvx /usr/local/bin/uvx | |
| # Copy environment code | |
| COPY . /app/env | |
| WORKDIR /app/env | |
| # Install dependencies | |
| RUN uv sync --no-editable | |
| # Set PATH to use the virtual environment | |
| ENV PATH="/app/env/.venv/bin:$PATH" | |
| # Set PYTHONPATH so imports work correctly | |
| ENV PYTHONPATH="/app/env:$PYTHONPATH" | |
| # Expose port | |
| EXPOSE 8000 | |
| # Health check | |
| HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \ | |
| CMD curl -f http://localhost:8000/health || exit 1 | |
| # Run the FastAPI server directly (no web interface to avoid Gradio issues) | |
| CMD ["sh", "-c", "cd /app/env && uvicorn server.app:app --host 0.0.0.0 --port 8000"] | |