Skip to content

Commit a77da52

Browse files
build: init py3 in base image.
1 parent 4229b47 commit a77da52

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

installer/Dockerfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,11 @@ COPY --chmod=700 . /opt/maxkb-app
1818
WORKDIR /opt/maxkb-app
1919
RUN rm -rf /opt/maxkb-app/ui && \
2020
pip install uv --break-system-packages && \
21-
. /opt/py3/bin/activate && \
22-
uv pip install -r pyproject.toml && \
21+
python -m uv pip install -r pyproject.toml && \
2322
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 {} + && \
2423
export MAXKB_CONFIG_TYPE=ENV && python3 /opt/maxkb-app/apps/manage.py compilemessages && \
2524
export PIP_TARGET=/opt/maxkb-app/sandbox/python-packages && \
26-
uv pip install --target=$PIP_TARGET requests pymysql psycopg2-binary && \
25+
python -m uv pip install --target=$PIP_TARGET requests pymysql psycopg2-binary && \
2726
rm -rf /opt/maxkb-app/installer
2827
COPY --from=web-build --chmod=700 ui /opt/maxkb-app/ui
2928

@@ -48,7 +47,6 @@ ENV MAXKB_VERSION="${DOCKER_IMAGE_TAG} (build at ${BUILD_AT}, commit: ${GITHUB_C
4847
MAXKB_LOCAL_MODEL_HOST=127.0.0.1 \
4948
MAXKB_LOCAL_MODEL_PORT=11636 \
5049
MAXKB_LOCAL_MODEL_PROTOCOL=http \
51-
PATH=/opt/py3/bin:$PATH \
5250
PIP_TARGET=/opt/maxkb/python-packages
5351

5452

installer/Dockerfile-base

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
FROM python:3.11-slim-trixie AS python-stage
22
RUN python3 -m venv /opt/py3
33

4-
54
FROM ghcr.io/1panel-dev/maxkb-vector-model:v2.0.2 AS vector-model
65

76
FROM postgres:17.6-trixie
@@ -38,7 +37,8 @@ RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
3837
rm -rf /var/lib/apt/lists/* /usr/share/doc/* /usr/share/man/* /usr/share/info/* /usr/share/locale/* /usr/share/lintian/* /usr/share/linda/* /var/cache/* /var/log/* /var/tmp/* /tmp/*
3938
COPY --from=vector-model --chmod=700 /opt/maxkb-app/model /opt/maxkb-app/model
4039

41-
ENV PGDATA=/opt/maxkb/data/postgresql/pgdata \
40+
ENV PATH=/opt/py3/bin:$PATH \
41+
PGDATA=/opt/maxkb/data/postgresql/pgdata \
4242
POSTGRES_USER=root \
4343
POSTGRES_PASSWORD=Password123@postgres \
4444
POSTGRES_MAX_CONNECTIONS=1000 \

0 commit comments

Comments
 (0)