| FROM python:3.11-slim
|
|
|
| WORKDIR /app
|
|
|
|
|
|
|
| RUN apt-get update && apt-get install -y --no-install-recommends \
|
| build-essential \
|
| pkg-config \
|
| libssl-dev \
|
| curl \
|
| && curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
|
| --default-toolchain stable \
|
| --profile minimal \
|
| && apt-get clean \
|
| && rm -rf /var/lib/apt/lists/*
|
|
|
| ENV PATH="/root/.cargo/bin:${PATH}"
|
|
|
|
|
| COPY requirements.txt .
|
| RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
|
| COPY app.py .
|
|
|
|
|
| EXPOSE 7860
|
|
|
|
|
|
|
| ENV PORT=7860
|
| ENV RATE_LIMIT_PER_MINUTE=20
|
|
|
|
|
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--proxy-headers", "--forwarded-allow-ips", "*"]
|
|
|