1- FROM swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/python:3.10.14
2- # FROM python:3.10.14
1+ ARG BUILD_CN=false
2+
3+ FROM docker.io/python:3.10.14
4+
35# prepare the java env
46WORKDIR /opt
57# download jdk
@@ -13,26 +15,32 @@ ENV JAVA_HOME=/opt/jdk
1315
1416WORKDIR /dataflow
1517
16-
17- RUN echo "deb http://mirrors.aliyun.com/debian bookworm main contrib non-free" > /etc/apt/sources.list && \
18- echo "deb http://mirrors.aliyun.com/debian-security bookworm-security main contrib non-free" >> /etc/apt/sources.list && \
19- echo "deb http://mirrors.aliyun.com/debian bookworm-updates main contrib non-free" >> /etc/apt/sources.list
18+ RUN if [ "$BUILD_CN" = "true" ]; then \
19+ echo "deb http://mirrors.aliyun.com/debian bookworm main contrib non-free" > /etc/apt/sources.list; \
20+ echo "deb http://mirrors.aliyun.com/debian-security bookworm-security main contrib non-free" >> /etc/apt/sources.list; \
21+ echo "deb http://mirrors.aliyun.com/debian bookworm-updates main contrib non-free" >> /etc/apt/sources.list; \
22+ fi
2023
2124# install 3rd-party system dependencies
2225# RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 libpq-dev -y
23- RUN apt-get update && apt-get install libpq-dev libgl1-mesa-glx -y
24- RUN apt install git-lfs && git lfs install && apt clean && rm -rf /var/lib/apt/lists/*
26+ RUN apt-get update && \
27+ apt-get install --no-install-recommends -y \
28+ libpq-dev \
29+ libgl1-mesa-glx \
30+ git-lfs && \
31+ apt-get clean && rm -rf /var/lib/apt/lists/* && \
32+ git lfs install
2533
2634# install data-flow then
2735COPY . .
2836
29- ENV PIP_INDEX_URL=https://mirrors.aliyun.com/pypi/simple/
30- ENV UV_INDEX_URL=https://mirrors.aliyun.com/pypi/simple/
31- ENV UV_EXTRA_INDEX_URL=https://mirrors.aliyun.com/pypi/simple/
32-
3337# Install deps
3438# RUN pip install --no-cache-dir --use-deprecated=legacy-resolver -r docker/dataflow_requirements.txt
35- RUN pip install --no-cache-dir -r docker/dataflow_requirements.txt
39+ RUN if [ "$BUILD_CN" = "true" ]; then \
40+ pip install --no-cache-dir -r docker/dataflow_requirements.txt -i https://mirrors.aliyun.com/pypi/simple/; \
41+ else \
42+ pip install --no-cache-dir -r docker/dataflow_requirements.txt; \
43+ fi
3644
3745# compile code
3846# RUN python -m compileall .
@@ -42,9 +50,9 @@ RUN pip install --no-cache-dir -r docker/dataflow_requirements.txt
4250# ENV PLAYWRIGHT_DOWNLOAD_HOST=https://storage.aliyun.com/playwright
4351# RUN playwright install --with-deps
4452
45- RUN git config --global user.email
"[email protected] " 46- RUN git config --global user.name "dataflow"
47- RUN git config --global --add safe.directory '*'
53+ RUN git config --global user.email
"[email protected] " && \ 54+ git config --global user.name "dataflow" && \
55+ git config --global --add safe.directory '*'
4856
4957# Start fastapi API Server
5058EXPOSE 8000
0 commit comments