diff --git a/.github/workflows/build-ruby-image.yml b/.github/workflows/build-ruby-image.yml index 591a134..71455cc 100644 --- a/.github/workflows/build-ruby-image.yml +++ b/.github/workflows/build-ruby-image.yml @@ -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 @@ -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 diff --git a/awslambda/Dockerfile b/awslambda/Dockerfile index a753546..d532843 100644 --- a/awslambda/Dockerfile +++ b/awslambda/Dockerfile @@ -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"