From ae5fb8fae30d85aa5e1031484d824f9a35faeadf Mon Sep 17 00:00:00 2001 From: liqiang-fit2cloud Date: Thu, 21 Aug 2025 15:20:53 +0800 Subject: [PATCH] build: init py3 in base image. --- installer/Dockerfile | 7 +------ installer/Dockerfile-base | 7 +++++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/installer/Dockerfile b/installer/Dockerfile index bce62fa76..da7b20e43 100644 --- a/installer/Dockerfile +++ b/installer/Dockerfile @@ -8,11 +8,8 @@ RUN cd ui && ls -la && if [ -d "dist" ]; then exit 0; fi && \ FROM ghcr.io/1panel-dev/maxkb-base:python3.11-pg17.6 AS stage-build -ARG DEPENDENCIES=" \ - python3-pip" - RUN apt-get update && \ - apt-get install -y --no-install-recommends $DEPENDENCIES && \ + apt-get install -y --no-install-recommends python3-pip && \ apt-get clean all && \ rm -rf /var/lib/apt/lists/* @@ -20,9 +17,7 @@ COPY --chmod=700 . /opt/maxkb-app WORKDIR /opt/maxkb-app RUN rm -rf /opt/maxkb-app/ui && \ - python3 -m venv /opt/py3 && \ pip install uv --break-system-packages && \ - . /opt/py3/bin/activate && \ uv pip install -r pyproject.toml && \ find /opt/maxkb-app -depth \( -name ".git*" -o -name ".docker*" -o -name ".idea*" -o -name ".editorconfig*" -o -name ".prettierrc*" -o -name "README.md" -o -name "poetry.lock" -o -name "pyproject.toml" \) -exec rm -rf {} + && \ export MAXKB_CONFIG_TYPE=ENV && python3 /opt/maxkb-app/apps/manage.py compilemessages && \ diff --git a/installer/Dockerfile-base b/installer/Dockerfile-base index b39a7fa4e..1607f6d4f 100644 --- a/installer/Dockerfile-base +++ b/installer/Dockerfile-base @@ -1,7 +1,14 @@ FROM python:3.11-slim-trixie AS python-stage +RUN mkdir -p /opt/maxkb-app && \ + cd /opt/maxkb-app && \ + python3 -m venv /opt/py3 && \ + . /opt/py3/bin/activate + FROM ghcr.io/1panel-dev/maxkb-vector-model:v2.0.2 AS vector-model + FROM postgres:17.6-trixie COPY --from=python-stage /usr/local /usr/local +COPY --from=python-stage /opt/py3 /opt/py3 COPY installer/*.sh /usr/bin/ COPY installer/init.sql /docker-entrypoint-initdb.d/