Skip to content

Commit

Permalink
serverless combine images
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkosm committed Dec 27, 2024
1 parent 54be929 commit ca4ff36
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 25 deletions.
26 changes: 1 addition & 25 deletions .github/workflows/image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

0 comments on commit ca4ff36

Please sign in to comment.