Spaces:
Sleeping
Sleeping
| FROM python:3.11-slim | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| curl build-essential python3-dev \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Install Rust | |
| RUN curl https://sh.rustup.rs -sSf | bash -s -- -y | |
| ENV PATH="/root/.cargo/bin:${PATH}" | |
| # Install maturin | |
| RUN pip install maturin | |
| # Set working directory | |
| WORKDIR /app | |
| # Copy your project files (including app.py and requirements.txt) | |
| COPY . . | |
| # Install Python dependencies | |
| RUN pip install -r requirements.txt | |
| # Build Rust extension | |
| RUN maturin build --release --manifest-path sample_rust/Cargo.toml | |
| # Install the generated wheel | |
| RUN pip install sample_rust/target/wheels/*.whl | |
| # Expose port Hugging Face uses | |
| EXPOSE 7860 | |
| # Start the Flask app | |
| CMD ["python3", "app.py"] |