Skip to content

Commit

Permalink
use the prebuilt tesseract
Browse files Browse the repository at this point in the history
  • Loading branch information
orangewolf committed Oct 10, 2023
1 parent 6978e0b commit 812f98a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/build-ruby-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ jobs:
build-ruby-image:
runs-on: ubuntu-latest
steps:
- name: Set env
run: >-
echo "TAG=${HEAD_TAG::8}" >> ${GITHUB_ENV};
echo ${HEAD_TAG::8}
env:
HEAD_TAG: ${{ inputs.tag || github.event.pull_request.head.sha || github.sha }}
shell: bash
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
Expand Down Expand Up @@ -48,8 +55,8 @@ jobs:
cp ../Dockerfile .
cp ../Gemfile* .
cp -r ../derivative_rodeo .
docker build -t ghcr.io/scientist-softserv/space_stone/awsrubylayer:latest .
docker build -t ghcr.io/scientist-softserv/space_stone/awsrubylayer:${TAG} .
- name: Push new docker image
run: |
docker push ghcr.io/scientist-softserv/space_stone/awsrubylayer:latest
docker push ghcr.io/scientist-softserv/space_stone/awsrubylayer:${TAG}
shell: bash
13 changes: 5 additions & 8 deletions awslambda/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -228,16 +228,13 @@ RUN bundle config set --local path build
RUN bundle

###############################################################################
# Zip all dependencies
# The end
###############################################################################

WORKDIR /opt
# RUN zip -r /root/ProcessDocumentLayer.zip *
RUN cp /opt/tesseract/share/tessdata/* /opt/share/tessdata/ && \
mkdir /opt/share/tessdata-best && cp -r /opt/share/tessdata/* /opt/share/tessdata-best && \
cd /opt/share/tessdata-best && curl -LO https://github.com/tesseract-ocr/tessdata_best/raw/main/eng.traineddata

###############################################################################
# Entrypoint: Copy zip file to host
###############################################################################
# TODO remove?
# ENTRYPOINT ["/bin/cp", "/root/ProcessDocumentLayer.zip", "/output"]
WORKDIR /opt

CMD "/bin/bash"

0 comments on commit 812f98a

Please sign in to comment.