Spaces:
Sleeping
Sleeping
| FROM python:3.11-slim | |
| # Install Rust and dependencies | |
| RUN apt update && apt install -y curl build-essential | |
| RUN curl https://sh.rustup.rs -sSf | sh -s -- -y | |
| ENV PATH="/root/.cargo/bin:${PATH}" | |
| WORKDIR /code | |
| # Copy app and dependencies | |
| COPY app.py . | |
| COPY requirements.txt . | |
| COPY sample_rust/ ./sample_rust/ | |
| # Install Python and Rust modules | |
| RUN pip install maturin | |
| RUN maturin build --release --manifest-path sample_rust/Cargo.toml | |
| RUN pip install target/wheels/*.whl | |
| RUN pip install -r requirements.txt | |
| EXPOSE 7860 | |
| CMD ["flask", "run", "--host=0.0.0.0", "--port=7860"] |