mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
build: init py3 in base image.
This commit is contained in:
parent
5ca82e1f4e
commit
ae5fb8fae3
|
|
@ -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 && \
|
||||
|
|
|
|||
|
|
@ -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/
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue