build: 分开镜像
This commit is contained in:
parent
863f0a65a4
commit
2433e72033
13
.github/workflows/build-and-push-python-pg.yml
vendored
13
.github/workflows/build-and-push-python-pg.yml
vendored
@ -2,7 +2,16 @@ name: build-and-push-python-pg
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
architecture:
|
||||||
|
description: 'Architecture'
|
||||||
|
required: true
|
||||||
|
default: 'linux/amd64'
|
||||||
|
type: choice
|
||||||
|
options:
|
||||||
|
- linux/amd64
|
||||||
|
- linux/arm64
|
||||||
|
- linux/amd64,linux/arm64
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push-python-pg-to-ghcr:
|
build-and-push-python-pg-to-ghcr:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -29,7 +38,7 @@ jobs:
|
|||||||
id: prepare
|
id: prepare
|
||||||
run: |
|
run: |
|
||||||
DOCKER_IMAGE=ghcr.io/maxkb-dev/python-pg
|
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
|
TAG_NAME=python3.11.8-pg15.3
|
||||||
DOCKER_IMAGE_TAGS="--tag ${DOCKER_IMAGE}:${TAG_NAME} --tag ${DOCKER_IMAGE}:latest"
|
DOCKER_IMAGE_TAGS="--tag ${DOCKER_IMAGE}:${TAG_NAME} --tag ${DOCKER_IMAGE}:latest"
|
||||||
echo ::set-output name=docker_image::${DOCKER_IMAGE}
|
echo ::set-output name=docker_image::${DOCKER_IMAGE}
|
||||||
|
|||||||
@ -2,6 +2,20 @@ name: build-and-push-vector-model
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
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:
|
jobs:
|
||||||
build-and-push-vector-model-to-ghcr:
|
build-and-push-vector-model-to-ghcr:
|
||||||
@ -29,8 +43,8 @@ jobs:
|
|||||||
id: prepare
|
id: prepare
|
||||||
run: |
|
run: |
|
||||||
DOCKER_IMAGE=ghcr.io/maxkb-dev/vector-model
|
DOCKER_IMAGE=ghcr.io/maxkb-dev/vector-model
|
||||||
DOCKER_PLATFORMS=linux/amd64,linux/arm64
|
DOCKER_PLATFORMS=${{ github.event.inputs.architecture }}
|
||||||
TAG_NAME=v1.0.0
|
TAG_NAME=${{ github.event.inputs.dockerImageTag }}
|
||||||
DOCKER_IMAGE_TAGS="--tag ${DOCKER_IMAGE}:${TAG_NAME} --tag ${DOCKER_IMAGE}:latest"
|
DOCKER_IMAGE_TAGS="--tag ${DOCKER_IMAGE}:${TAG_NAME} --tag ${DOCKER_IMAGE}:latest"
|
||||||
echo ::set-output name=docker_image::${DOCKER_IMAGE}
|
echo ::set-output name=docker_image::${DOCKER_IMAGE}
|
||||||
echo ::set-output name=version::${TAG_NAME}
|
echo ::set-output name=version::${TAG_NAME}
|
||||||
|
|||||||
13
.github/workflows/build-and-push.yml
vendored
13
.github/workflows/build-and-push.yml
vendored
@ -7,6 +7,15 @@ on:
|
|||||||
description: 'Docker Image Tag'
|
description: 'Docker Image Tag'
|
||||||
default: 'v1.0.0'
|
default: 'v1.0.0'
|
||||||
required: true
|
required: true
|
||||||
|
architecture:
|
||||||
|
description: 'Architecture'
|
||||||
|
required: true
|
||||||
|
default: 'linux/amd64'
|
||||||
|
type: choice
|
||||||
|
options:
|
||||||
|
- linux/amd64
|
||||||
|
- linux/arm64
|
||||||
|
- linux/amd64,linux/arm64
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push-fit2cloud-registry:
|
build-and-push-fit2cloud-registry:
|
||||||
@ -34,7 +43,7 @@ jobs:
|
|||||||
id: prepare
|
id: prepare
|
||||||
run: |
|
run: |
|
||||||
DOCKER_IMAGE=registry-hkproxy.fit2cloud.com/maxkb/maxkb
|
DOCKER_IMAGE=registry-hkproxy.fit2cloud.com/maxkb/maxkb
|
||||||
DOCKER_PLATFORMS=linux/amd64
|
DOCKER_PLATFORMS=${{ github.event.inputs.architecture }}
|
||||||
TAG_NAME=${{ github.event.inputs.dockerImageTag }}
|
TAG_NAME=${{ github.event.inputs.dockerImageTag }}
|
||||||
DOCKER_IMAGE_TAGS="--tag ${DOCKER_IMAGE}:${TAG_NAME} --tag ${DOCKER_IMAGE}:latest"
|
DOCKER_IMAGE_TAGS="--tag ${DOCKER_IMAGE}:${TAG_NAME} --tag ${DOCKER_IMAGE}:latest"
|
||||||
echo ::set-output name=docker_image::${DOCKER_IMAGE}
|
echo ::set-output name=docker_image::${DOCKER_IMAGE}
|
||||||
@ -90,7 +99,7 @@ jobs:
|
|||||||
id: prepare
|
id: prepare
|
||||||
run: |
|
run: |
|
||||||
DOCKER_IMAGE=ghcr.io/maxkb-dev/maxkb
|
DOCKER_IMAGE=ghcr.io/maxkb-dev/maxkb
|
||||||
DOCKER_PLATFORMS=linux/amd64
|
DOCKER_PLATFORMS=${{ github.event.inputs.architecture }}
|
||||||
TAG_NAME=${{ github.event.inputs.dockerImageTag }}
|
TAG_NAME=${{ github.event.inputs.dockerImageTag }}
|
||||||
DOCKER_IMAGE_TAGS="--tag ${DOCKER_IMAGE}:${TAG_NAME} --tag ${DOCKER_IMAGE}:latest"
|
DOCKER_IMAGE_TAGS="--tag ${DOCKER_IMAGE}:${TAG_NAME} --tag ${DOCKER_IMAGE}:latest"
|
||||||
echo ::set-output name=docker_image::${DOCKER_IMAGE}
|
echo ::set-output name=docker_image::${DOCKER_IMAGE}
|
||||||
|
|||||||
@ -10,7 +10,6 @@ RUN cd ui && \
|
|||||||
FROM ghcr.io/maxkb-dev/python-pg:python3.11.8-pg15.3
|
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
|
RUN mkdir -p /opt/maxkb/app && mkdir -p /opt/maxkb/model && mkdir -p /opt/maxkb/conf
|
||||||
VOLUME /opt/maxkb
|
|
||||||
# 拷贝项目
|
# 拷贝项目
|
||||||
COPY . /opt/maxkb/app
|
COPY . /opt/maxkb/app
|
||||||
COPY installer/config.yaml /opt/maxkb/conf
|
COPY installer/config.yaml /opt/maxkb/conf
|
||||||
@ -37,6 +36,7 @@ RUN poetry export -f requirements.txt --output requirements.txt --without-hashes
|
|||||||
# 下载python依赖
|
# 下载python依赖
|
||||||
RUN pip3 install --no-cache-dir -r requirements.txt
|
RUN pip3 install --no-cache-dir -r requirements.txt
|
||||||
# 启动命令
|
# 启动命令
|
||||||
|
VOLUME /opt/maxkb/conf
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
COPY installer/run-maxkb.sh /usr/bin/
|
COPY installer/run-maxkb.sh /usr/bin/
|
||||||
RUN chmod 755 /usr/bin/run-maxkb.sh
|
RUN chmod 755 /usr/bin/run-maxkb.sh
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user