From ca4ff36e8b837946a468a30deedabfc465b48dc8 Mon Sep 17 00:00:00 2001 From: Thomas Kosmas Date: Fri, 27 Dec 2024 11:14:55 +0200 Subject: [PATCH] serverless combine images --- .github/workflows/image.yml | 26 +------------------------- Dockerfile | 6 ++++++ 2 files changed, 7 insertions(+), 25 deletions(-) diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml index f8036f2..27ac103 100644 --- a/.github/workflows/image.yml +++ b/.github/workflows/image.yml @@ -31,28 +31,4 @@ jobs: docker build . --tag ghcr.io/mendableai/mineru-api:latest docker image ls ghcr.io/mendableai/mineru-api:latest docker history ghcr.io/mendableai/mineru-api:latest - docker push ghcr.io/mendableai/mineru-api:latest - - push-serverless: - runs-on: ubuntu-latest-m - defaults: - run: - working-directory: './' - steps: - - name: 'Checkout GitHub Action' - uses: actions/checkout@main - - - name: 'Login to GitHub Container Registry' - uses: docker/login-action@v1 - with: - registry: ghcr.io - username: ${{github.actor}} - password: ${{secrets.GITHUB_TOKEN}} - - - name: 'Build Serverless Image' - run: | - docker build . -f Dockerfile.serverless --tag ghcr.io/mendableai/mineru-api-serverless:latest - docker image ls ghcr.io/mendableai/mineru-api-serverless:latest - docker history ghcr.io/mendableai/mineru-api-serverless:latest - docker push ghcr.io/mendableai/mineru-api-serverless:latest - + docker push ghcr.io/mendableai/mineru-api:latest \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index f6bab97..8497940 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,10 +27,16 @@ RUN poetry config virtualenvs.create false && \ #use paddlegpu RUN pip install paddlepaddle-gpu==3.0.0b1 -i https://www.paddlepaddle.org.cn/packages/stable/cu118/ +#for runpod serverless +RUN pip install runpod + + COPY . ./ COPY magic-pdf.gpu.json /root/magic-pdf.json RUN python3.10 download_models.py +#serverless +# CMD ["sh", "-c", "ls && python3.10 serverless.py"] CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "3000"]