Dockerfile 810 Bytes
FROM python:3.12-slim
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Asia/Shanghai PROJECT_ROOT=/app ENV=docker APP_LOG_TYPE=file,console

# 使用 Debian 的阿里云镜像
RUN echo "deb http://mirrors.aliyun.com/debian/ bookworm main contrib non-free" > /etc/apt/sources.list && \
    echo "deb http://mirrors.aliyun.com/debian/ bookworm-updates main contrib non-free" >> /etc/apt/sources.list && \
    echo "deb http://mirrors.aliyun.com/debian-security/ bookworm-security main contrib non-free" >> /etc/apt/sources.list

# 安装系统依赖
RUN apt update && apt install -y --no-install-recommends gcc curl vim && rm -rf /var/lib/apt/lists/*
# 安装uv工具
RUN pip install --no-cache-dir uv
WORKDIR /app
COPY . .
RUN uv pip install --system --no-cache ".[es,postgres]"

EXPOSE 8000

CMD ["python", "main.py"]