|
|
| 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_VERSION=1.6.1
|
|
|
|
|
| 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 8000
|
|
|
|
|
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
|
|
|