feat: enhance Dockerfile and build scripts for customizable APT mirror
- Added support for customizable APT mirror in the Dockerfile for the docreader service, allowing users to specify a mirror via build arguments. - Updated docker-compose.yml to pass the APT_MIRROR argument during the build process. - Modified build_images.sh script to include the APT_MIRROR argument when building the docreader image. - Updated .gitignore to exclude .cursor/ directory. This update improves flexibility in package management during the image build process.
This commit is contained in:
@@ -3,9 +3,11 @@
|
||||
# =========================
|
||||
FROM python:3.10.18-bookworm AS builder
|
||||
|
||||
# 切换 apt 源到清华
|
||||
RUN sed -i 's@http://deb.debian.org@https://mirrors.tuna.tsinghua.edu.cn@g' /etc/apt/sources.list.d/debian.sources && \
|
||||
sed -i 's@http://security.debian.org@https://mirrors.tuna.tsinghua.edu.cn@g' /etc/apt/sources.list.d/debian.sources
|
||||
ARG APT_MIRROR=""
|
||||
RUN if [ -n "$APT_MIRROR" ]; then \
|
||||
sed -i "s@http://deb.debian.org@${APT_MIRROR}@g" /etc/apt/sources.list.d/debian.sources && \
|
||||
sed -i "s@http://security.debian.org@${APT_MIRROR}@g" /etc/apt/sources.list.d/debian.sources; \
|
||||
fi
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
@@ -67,9 +69,11 @@ RUN chmod +x docreader/scripts/generate_proto.sh && \
|
||||
# =========================
|
||||
FROM python:3.10.18-bookworm AS runner
|
||||
|
||||
# 切换 apt 源到清华
|
||||
RUN sed -i 's@http://deb.debian.org@https://mirrors.tuna.tsinghua.edu.cn@g' /etc/apt/sources.list.d/debian.sources && \
|
||||
sed -i 's@http://security.debian.org@https://mirrors.tuna.tsinghua.edu.cn@g' /etc/apt/sources.list.d/debian.sources
|
||||
ARG APT_MIRROR=""
|
||||
RUN if [ -n "$APT_MIRROR" ]; then \
|
||||
sed -i "s@http://deb.debian.org@${APT_MIRROR}@g" /etc/apt/sources.list.d/debian.sources && \
|
||||
sed -i "s@http://security.debian.org@${APT_MIRROR}@g" /etc/apt/sources.list.d/debian.sources; \
|
||||
fi
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
|
||||
Reference in New Issue
Block a user