| |
| FROM python:3.11-slim |
|
|
| |
| ENV HOME=/home/user \ |
| PATH=/home/user/.local/bin:$PATH \ |
| PYTHONDONTWRITEBYTECODE=1 \ |
| PYTHONUNBUFFERED=1 |
|
|
| |
| RUN apt-get update && apt-get install -y --no-install-recommends \ |
| build-essential \ |
| git \ |
| curl \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| RUN useradd -ms /bin/bash user |
| USER user |
| WORKDIR $HOME/app |
|
|
| |
| COPY --chown=user . . |
|
|
| |
| RUN pip install --no-cache-dir --upgrade pip \ |
| && pip install --no-cache-dir -r requirements.txt |
|
|
| |
| EXPOSE 7860 |
|
|
| |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "4"] |
|
|