diff --git a/.github/workflows/docker-caddy.yml b/.github/workflows/docker-caddy.yml index 2f42731..8be565a 100644 --- a/.github/workflows/docker-caddy.yml +++ b/.github/workflows/docker-caddy.yml @@ -31,4 +31,3 @@ jobs: tags: nite07/caddy:latest platforms: linux/amd64 context: ./caddy - file: ./caddy/Containerfile diff --git a/.github/workflows/docker-mineru.yml b/.github/workflows/docker-mineru.yml new file mode 100644 index 0000000..0641d1b --- /dev/null +++ b/.github/workflows/docker-mineru.yml @@ -0,0 +1,33 @@ +name: docker-mineru + +on: + # schedule: + # - cron: "0 0 * * 1" + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v4 + + - name: Login to Docker Hub + uses: docker/login-action@v4 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v7 + with: + push: true + tags: nite07/mineru:latest + platforms: linux/amd64 + context: ./mineru diff --git a/caddy/Containerfile b/caddy/Dockerfile similarity index 100% rename from caddy/Containerfile rename to caddy/Dockerfile diff --git a/mineru/Dockerfile b/mineru/Dockerfile new file mode 100644 index 0000000..a9aaa6a --- /dev/null +++ b/mineru/Dockerfile @@ -0,0 +1,25 @@ +# Use the official vllm image for gpu with Volta、Turing、Ampere、Ada Lovelace、Hopper、Blackwell architecture (7.0 <= Compute Capability <= 12.0) +# Compute Capability version query (https://developer.nvidia.com/cuda-gpus) +# support x86_64 architecture and ARM(AArch64) architecture +FROM docker.io/vllm/vllm-openai:v0.11.2 + +# Install libgl for opencv support & Noto fonts for Chinese characters +RUN apt-get update && \ + apt-get install -y \ + fonts-noto-core \ + fonts-noto-cjk \ + fontconfig \ + libgl1 && \ + fc-cache -fv && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* + +# Install mineru latest +RUN python3 -m pip install -U 'mineru[all]>=3.0.0' --break-system-packages && \ + python3 -m pip cache purge + +# Download models and update the configuration file +RUN /bin/bash -c "mineru-models-download -s huggingface -m all" + +# Set the entry point to activate the virtual environment and run the command line tool +ENTRYPOINT ["/bin/bash", "-c", "export MINERU_MODEL_SOURCE=local && exec \"$@\"", "--"] \ No newline at end of file