diff --git a/.github/workflows/build-and-push-python-pg.yml b/.github/workflows/build-and-push-python-pg.yml index b91b76d64..7ee54ae6c 100644 --- a/.github/workflows/build-and-push-python-pg.yml +++ b/.github/workflows/build-and-push-python-pg.yml @@ -2,7 +2,16 @@ name: build-and-push-python-pg on: workflow_dispatch: - + inputs: + architecture: + description: 'Architecture' + required: true + default: 'linux/amd64' + type: choice + options: + - linux/amd64 + - linux/arm64 + - linux/amd64,linux/arm64 jobs: build-and-push-python-pg-to-ghcr: runs-on: ubuntu-latest @@ -29,7 +38,7 @@ jobs: id: prepare run: | DOCKER_IMAGE=ghcr.io/maxkb-dev/python-pg - DOCKER_PLATFORMS=linux/amd64,linux/arm64 + DOCKER_PLATFORMS=${{ github.event.inputs.architecture }} TAG_NAME=python3.11.8-pg15.3 DOCKER_IMAGE_TAGS="--tag ${DOCKER_IMAGE}:${TAG_NAME} --tag ${DOCKER_IMAGE}:latest" echo ::set-output name=docker_image::${DOCKER_IMAGE} diff --git a/.github/workflows/build-and-push-vector-model.yml b/.github/workflows/build-and-push-vector-model.yml index f83e5192f..267548e06 100644 --- a/.github/workflows/build-and-push-vector-model.yml +++ b/.github/workflows/build-and-push-vector-model.yml @@ -2,6 +2,20 @@ name: build-and-push-vector-model on: workflow_dispatch: + inputs: + dockerImageTag: + description: 'Docker Image Tag' + default: 'v1.0.0' + required: true + architecture: + description: 'Architecture' + required: true + default: 'linux/amd64' + type: choice + options: + - linux/amd64 + - linux/arm64 + - linux/amd64,linux/arm64 jobs: build-and-push-vector-model-to-ghcr: @@ -29,8 +43,8 @@ jobs: id: prepare run: | DOCKER_IMAGE=ghcr.io/maxkb-dev/vector-model - DOCKER_PLATFORMS=linux/amd64,linux/arm64 - TAG_NAME=v1.0.0 + DOCKER_PLATFORMS=${{ github.event.inputs.architecture }} + TAG_NAME=${{ github.event.inputs.dockerImageTag }} DOCKER_IMAGE_TAGS="--tag ${DOCKER_IMAGE}:${TAG_NAME} --tag ${DOCKER_IMAGE}:latest" echo ::set-output name=docker_image::${DOCKER_IMAGE} echo ::set-output name=version::${TAG_NAME} diff --git a/.github/workflows/build-and-push.yml b/.github/workflows/build-and-push.yml index aa24c95ff..9f9b150ec 100644 --- a/.github/workflows/build-and-push.yml +++ b/.github/workflows/build-and-push.yml @@ -7,6 +7,15 @@ on: description: 'Docker Image Tag' default: 'v1.0.0' required: true + architecture: + description: 'Architecture' + required: true + default: 'linux/amd64' + type: choice + options: + - linux/amd64 + - linux/arm64 + - linux/amd64,linux/arm64 jobs: build-and-push-fit2cloud-registry: @@ -34,7 +43,7 @@ jobs: id: prepare run: | DOCKER_IMAGE=registry-hkproxy.fit2cloud.com/maxkb/maxkb - DOCKER_PLATFORMS=linux/amd64 + DOCKER_PLATFORMS=${{ github.event.inputs.architecture }} TAG_NAME=${{ github.event.inputs.dockerImageTag }} DOCKER_IMAGE_TAGS="--tag ${DOCKER_IMAGE}:${TAG_NAME} --tag ${DOCKER_IMAGE}:latest" echo ::set-output name=docker_image::${DOCKER_IMAGE} @@ -90,7 +99,7 @@ jobs: id: prepare run: | DOCKER_IMAGE=ghcr.io/maxkb-dev/maxkb - DOCKER_PLATFORMS=linux/amd64 + DOCKER_PLATFORMS=${{ github.event.inputs.architecture }} TAG_NAME=${{ github.event.inputs.dockerImageTag }} DOCKER_IMAGE_TAGS="--tag ${DOCKER_IMAGE}:${TAG_NAME} --tag ${DOCKER_IMAGE}:latest" echo ::set-output name=docker_image::${DOCKER_IMAGE} diff --git a/installer/Dockerfile b/installer/Dockerfile index f00b454b7..4185fd694 100644 --- a/installer/Dockerfile +++ b/installer/Dockerfile @@ -10,7 +10,6 @@ RUN cd ui && \ FROM ghcr.io/maxkb-dev/python-pg:python3.11.8-pg15.3 # 创建工作目录 RUN mkdir -p /opt/maxkb/app && mkdir -p /opt/maxkb/model && mkdir -p /opt/maxkb/conf -VOLUME /opt/maxkb # 拷贝项目 COPY . /opt/maxkb/app COPY installer/config.yaml /opt/maxkb/conf @@ -37,6 +36,7 @@ RUN poetry export -f requirements.txt --output requirements.txt --without-hashes # 下载python依赖 RUN pip3 install --no-cache-dir -r requirements.txt # 启动命令 +VOLUME /opt/maxkb/conf EXPOSE 8000 COPY installer/run-maxkb.sh /usr/bin/ RUN chmod 755 /usr/bin/run-maxkb.sh