This commit is contained in:
2026-01-09 08:49:18 +08:00
parent f3f1609455
commit 4d228ba739
4 changed files with 52 additions and 11 deletions

View File

@@ -3,11 +3,19 @@ FROM ghcr.io/astral-sh/uv:python3.12-bookworm
# Install uv.
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
# Install system dependencies including libpq
RUN apt-get update && apt-get install -y \
# 配置 apt 阿里云镜像源并安装系统依赖
RUN if [ -f /etc/apt/sources.list.d/debian.sources ]; then \
sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list.d/debian.sources; \
elif [ -f /etc/apt/sources.list ]; then \
sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list; \
fi && \
apt-get update && apt-get install -y \
libpq-dev git \
&& rm -rf /var/lib/apt/lists/*
# 配置 uv 使用阿里云 PyPI 镜像
ENV UV_INDEX_URL="https://mirrors.aliyun.com/pypi/simple/"
WORKDIR /app
# Copy the application into the container.