| |
| FROM python:3.11-slim |
|
|
| |
| RUN rm -rf /etc/apt/sources.list.d/* && \ |
| echo "deb http://mirrors.ustc.edu.cn/debian bookworm main" > /etc/apt/sources.list && \ |
| echo "deb http://mirrors.ustc.edu.cn/debian bookworm-updates main" >> /etc/apt/sources.list && \ |
| echo "deb http://mirrors.ustc.edu.cn/debian-security bookworm-security main" >> /etc/apt/sources.list |
|
|
| |
| WORKDIR /app |
|
|
| |
| ENV PYTHONUNBUFFERED=1 \ |
| PYTHONDONTWRITEBYTECODE=1 \ |
| POETRY_NO_INTERACTION=1 \ |
| POETRY_VIRTUALENVS_IN_PROJECT=1 \ |
| POETRY_CACHE_DIR=/tmp/poetry_cache |
|
|
| |
| RUN apt-get update \ |
| && apt-get install -y --no-install-recommends \ |
| curl \ |
| build-essential \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| COPY . . |
|
|
| |
| RUN pip install --no-cache-dir -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple |
|
|
| |
| EXPOSE 8080 |
|
|
| |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8080"] |