| FROM python:3.11-slim |
|
|
| WORKDIR /app |
|
|
| |
| RUN apt-get update && apt-get install -y \ |
| curl \ |
| build-essential \ |
| pkg-config \ |
| libssl-dev \ |
| libgit2-dev \ |
| git \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y |
| ENV PATH="/root/.cargo/bin:${PATH}" |
|
|
| |
| COPY requirements.txt . |
| RUN pip install --no-cache-dir -r requirements.txt |
|
|
| COPY src/ src/ |
| COPY Cargo.toml . |
| COPY app.py . |
|
|
| |
| RUN pip install maturin |
| RUN cd /app && maturin build --release |
| RUN pip install /app/target/wheels/uspoo_core-*.whl |
|
|
| |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |