2025-08-19 09:21:46 +00:00
|
|
|
FROM node:24-alpine AS web-build
|
2025-04-18 06:10:16 +00:00
|
|
|
COPY ui ui
|
2025-08-20 07:53:33 +00:00
|
|
|
RUN cd ui && ls -la && if [ -d "dist" ]; then exit 0; fi && \
|
2025-08-19 10:26:45 +00:00
|
|
|
npm install --prefer-offline --no-audit && \
|
2025-08-19 10:35:38 +00:00
|
|
|
npm install -D concurrently && \
|
|
|
|
|
NODE_OPTIONS="--max-old-space-size=4096" npx concurrently "npm run build" "npm run build-chat" && \
|
2025-06-24 07:50:25 +00:00
|
|
|
find . -maxdepth 1 ! -name '.' ! -name 'dist' ! -name 'public' -exec rm -rf {} +
|
2025-07-09 01:59:59 +00:00
|
|
|
|
2025-08-22 06:18:46 +00:00
|
|
|
FROM ghcr.io/1panel-dev/maxkb-base:python3.11-pg17.6 AS stage-build
|
2025-08-08 09:32:46 +00:00
|
|
|
COPY --chmod=700 . /opt/maxkb-app
|
2025-08-22 03:28:15 +00:00
|
|
|
RUN apt-get update && \
|
|
|
|
|
apt-get install -y --no-install-recommends gettext libexpat1-dev libffi-dev && \
|
|
|
|
|
apt-get clean all && \
|
|
|
|
|
rm -rf /var/lib/apt/lists/*
|
2025-04-18 06:10:16 +00:00
|
|
|
WORKDIR /opt/maxkb-app
|
2025-07-09 01:59:59 +00:00
|
|
|
RUN rm -rf /opt/maxkb-app/ui && \
|
2025-08-22 06:18:46 +00:00
|
|
|
pip install uv --break-system-packages && \
|
2025-08-22 08:13:13 +00:00
|
|
|
python -m uv pip -- install --prefer-binary -r pyproject.toml && \
|
2025-06-24 08:13:59 +00:00
|
|
|
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 {} + && \
|
2025-08-22 06:18:46 +00:00
|
|
|
python /opt/maxkb-app/apps/manage.py compilemessages && \
|
|
|
|
|
export PIP_TARGET=/opt/maxkb-app/sandbox/python-packages && \
|
2025-08-22 08:13:13 +00:00
|
|
|
python -m uv pip -- install --prefer-binary --target=$PIP_TARGET requests pymysql psycopg2-binary && \
|
2025-06-24 10:23:30 +00:00
|
|
|
rm -rf /opt/maxkb-app/installer
|
2025-08-08 09:32:46 +00:00
|
|
|
COPY --from=web-build --chmod=700 ui /opt/maxkb-app/ui
|
2025-04-18 06:10:16 +00:00
|
|
|
|
2025-08-19 01:55:40 +00:00
|
|
|
FROM ghcr.io/1panel-dev/maxkb-base:python3.11-pg17.6
|
2025-04-18 06:10:16 +00:00
|
|
|
ARG DOCKER_IMAGE_TAG=dev \
|
|
|
|
|
BUILD_AT \
|
|
|
|
|
GITHUB_COMMIT
|
|
|
|
|
|
|
|
|
|
ENV MAXKB_VERSION="${DOCKER_IMAGE_TAG} (build at ${BUILD_AT}, commit: ${GITHUB_COMMIT})" \
|
|
|
|
|
MAXKB_DB_NAME=maxkb \
|
|
|
|
|
MAXKB_DB_HOST=127.0.0.1 \
|
|
|
|
|
MAXKB_DB_PORT=5432 \
|
|
|
|
|
MAXKB_DB_USER=${POSTGRES_USER} \
|
|
|
|
|
MAXKB_DB_PASSWORD=${POSTGRES_PASSWORD} \
|
|
|
|
|
MAXKB_DB_MAX_OVERFLOW=80 \
|
2025-04-18 06:17:59 +00:00
|
|
|
MAXKB_REDIS_HOST=127.0.0.1 \
|
2025-06-04 05:59:59 +00:00
|
|
|
MAXKB_REDIS_PORT=6379 \
|
2025-06-16 08:44:58 +00:00
|
|
|
MAXKB_REDIS_DB=0 \
|
2025-04-18 06:17:59 +00:00
|
|
|
MAXKB_REDIS_PASSWORD=${REDIS_PASSWORD} \
|
2025-04-18 06:10:16 +00:00
|
|
|
MAXKB_EMBEDDING_MODEL_PATH=/opt/maxkb-app/model/embedding \
|
2025-04-18 06:45:36 +00:00
|
|
|
MAXKB_EMBEDDING_MODEL_NAME=/opt/maxkb-app/model/embedding/shibing624_text2vec-base-chinese \
|
2025-06-16 11:18:20 +00:00
|
|
|
MAXKB_LOCAL_MODEL_HOST=127.0.0.1 \
|
|
|
|
|
MAXKB_LOCAL_MODEL_PORT=11636 \
|
|
|
|
|
MAXKB_LOCAL_MODEL_PROTOCOL=http \
|
2025-08-13 06:57:50 +00:00
|
|
|
PIP_TARGET=/opt/maxkb/python-packages
|
|
|
|
|
|
2025-04-18 06:10:16 +00:00
|
|
|
|
2025-04-21 08:39:20 +00:00
|
|
|
WORKDIR /opt/maxkb-app
|
2025-08-22 06:18:46 +00:00
|
|
|
COPY --from=stage-build /opt/maxkb-app /opt/maxkb-app
|
|
|
|
|
COPY --from=stage-build /opt/py3 /opt/py3
|
2025-04-18 06:10:16 +00:00
|
|
|
|
2025-08-08 09:32:46 +00:00
|
|
|
RUN chmod 755 /tmp
|
2025-04-18 06:10:16 +00:00
|
|
|
|
|
|
|
|
EXPOSE 8080
|
|
|
|
|
VOLUME /opt/maxkb
|
|
|
|
|
ENTRYPOINT ["bash", "-c"]
|
|
|
|
|
CMD [ "/usr/bin/start-all.sh" ]
|