Spaces:
Sleeping
Sleeping
Download Dockerfile from ocx2025/basicsearch: direct link, hf CLI and curl.
- Browser
- Download file 760 Bytes
-
https://huggingface.co/spaces/ocx2025/basicsearch/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/ocx2025/basicsearch/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/ocx2025/basicsearch/resolve/main/Dockerfile
760 Bytes
| # Use Python 3.13 slim image as base | |
| FROM python:3.13-slim | |
| # Set working directory | |
| WORKDIR /app | |
| # Install uv for fast dependency management | |
| COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv | |
| # Set environment variables | |
| ENV PYTHONUNBUFFERED=1 \ | |
| PYTHONDONTWRITEBYTECODE=1 \ | |
| UV_SYSTEM_PYTHON=1 \ | |
| PORT=7860 | |
| # Copy project files | |
| COPY pyproject.toml uv.lock* ./ | |
| COPY server.py app.py ./ | |
| # Install dependencies using uv | |
| RUN uv pip install --system -r pyproject.toml | |
| # Expose port for HTTP server | |
| EXPOSE 7860 | |
| # Health check | |
| HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ | |
| CMD python -c "import requests; requests.get('http://localhost:7860/health')" || exit 1 | |
| # Run the FastAPI app | |
| CMD ["python", "app.py"] | |