@@ -45,8 +45,52 @@ COPY g2-ssr/charts/* /app/charts/
4545
4646RUN npm install
4747
48+ FROM registry.cn-qingdao.aliyuncs.com/dataease/sqlbot-base:latest AS python-builder
4849# Runtime stage
49- FROM registry.cn-qingdao.aliyuncs.com/dataease/sqlbot-base:latest
50+ # FROM registry.cn-qingdao.aliyuncs.com/dataease/sqlbot-base:latest
51+ FROM registry.cn-qingdao.aliyuncs.com/dataease/postgres:17.6
52+
53+ # python environment
54+ COPY --from=python-builder /usr/local /usr/local
55+
56+ RUN ln -sf python3.11 /usr/local/bin/python && \
57+ ln -sf pip /usr/local/bin/pip3
58+
59+ ENV PYTHONPATH=/usr/local/lib/python3.11:$PYTHONPATH
60+ ENV PATH=/usr/local/bin:$PATH
61+
62+ RUN python --version && pip --version
63+
64+ # Install uv tool
65+ COPY --from=ghcr.io/astral-sh/uv:0.7.8 /uv /uvx /bin/
66+
67+ RUN apt-get update && apt-get install -y --no-install-recommends \
68+ build-essential \
69+ curl \
70+ gnupg \
71+ gcc \
72+ g++ \
73+ libcairo2-dev \
74+ libpango1.0-dev \
75+ libjpeg-dev \
76+ libgif-dev \
77+ librsvg2-dev \
78+ && curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
79+ && apt-get install -y nodejs \
80+ && curl -L --connect-timeout 60 -m 1800 https://fit2cloud-support.oss-cn-beijing.aliyuncs.com/xpack-license/get-validator-linux | sh \
81+ && rm -rf /var/lib/apt/lists/* \
82+ chmod g-xr /usr/local/bin/* /usr/bin/* /bin/* /usr/sbin/* /sbin/* /usr/lib/postgresql/17/bin/* && \
83+ chmod g+xr /usr/bin/ld.so && \
84+ chmod g+x /usr/local/bin/python* && \
85+
86+ ARG DEPENDENCIES=" \
87+ vim \
88+ postgresql-17-pgvector"
89+
90+ # ENV PGDATA=/var/lib/postgresql/data \
91+ # POSTGRES_USER=root \
92+ # POSTGRES_PASSWORD=Password123@pg \
93+ # POSTGRES_DB=sqlbot
5094
5195# Set runtime environment variables
5296ENV PYTHONUNBUFFERED=1
@@ -65,10 +109,11 @@ WORKDIR ${SQLBOT_HOME}/app
65109
66110RUN mkdir -p /opt/sqlbot/images /opt/sqlbot/g2-ssr
67111
68- EXPOSE 3000 8000 8001
112+ EXPOSE 3000 8000 8001 5432
69113
70114# Add health check
71115HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
72116 CMD curl -f http://localhost:8000 || exit 1
73117
118+ CMD ["/usr/local/bin/docker-entrypoint.sh" ]
74119ENTRYPOINT ["sh" , "start.sh" ]
0 commit comments