-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from nenadjakic/feature/docker-ci-readme-clean-up
Docker deploy and ci workflow
- Loading branch information
Showing
21 changed files
with
399 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
MONGODB_PORT=27017 | ||
APP_PORT=8990 | ||
OCR_TESSERACT_DATA-PATH=/usr/local/share/tessdata/ | ||
|
||
TESSERACT_VERSION=5.4.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up JDK 21 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: '21' | ||
distribution: 'temurin' | ||
|
||
- name: Make gradlew executable | ||
run: chmod +x ./gradlew | ||
|
||
- name: Run build with Gradle Wrapper | ||
run: ./gradlew build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
readarray -t languages < <(sed 's/\r$//' languages.txt) | ||
for i in "${languages[@]}" | ||
do | ||
echo "Downloading ${i}.traineddata" | ||
wget -qO ${i}.traineddata https://github.com/tesseract-ocr/tessdata_best/blob/main/${i}.traineddata?raw=true | ||
done | ||
echo "Done" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
readarray -t scripts < <(sed 's/\r$//' scripts.txt) | ||
for i in "${scripts[@]}" | ||
do | ||
echo "Downloading ${i}.traineddata" | ||
wget -qO ${i}.traineddata https://github.com/tesseract-ocr/tessdata_best/blob/main/script/${i}.traineddata?raw=true | ||
done | ||
echo "Done" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
hrv | ||
eng | ||
deu | ||
ita | ||
fra | ||
lat | ||
ell | ||
osd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Cyrillic | ||
Fraktur | ||
Greek | ||
Latin | ||
Hebrew | ||
Arabic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
FROM eclipse-temurin:21-jdk AS app_stage | ||
|
||
WORKDIR /app | ||
|
||
COPY build.gradle.kts . | ||
COPY settings.gradle.kts . | ||
COPY gradlew . | ||
COPY gradle/ ./gradle | ||
|
||
RUN ./gradlew clean | ||
|
||
COPY src/ ./src/ | ||
|
||
RUN ./gradlew clean bootJar | ||
|
||
|
||
FROM ubuntu:22.04 AS tesseract | ||
|
||
LABEL authors="nenadjakic" | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get -y update | ||
RUN apt-get -y install \ | ||
automake \ | ||
ca-certificates \ | ||
g++ \ | ||
git \ | ||
libtool \ | ||
libleptonica-dev \ | ||
make \ | ||
pkg-config | ||
|
||
RUN apt-get -y install --no-install-recommends \ | ||
asciidoc \ | ||
docbook-xsl \ | ||
xsltproc | ||
|
||
WORKDIR /src | ||
|
||
ARG TESSERACT_VERSION | ||
|
||
RUN git clone -b $TESSERACT_VERSION https://github.com/tesseract-ocr/tesseract.git | ||
|
||
WORKDIR /src/tesseract | ||
|
||
RUN ./autogen.sh | ||
RUN ./configure | ||
RUN make | ||
RUN make install | ||
RUN ldconfig | ||
|
||
RUN apt-get -y install \ | ||
wget | ||
|
||
WORKDIR /usr/local/share/tessdata/ | ||
|
||
COPY .tesseract/get-languages.sh . | ||
COPY .tesseract/languages.txt . | ||
|
||
RUN chmod +x ./get-languages.sh | ||
RUN ./get-languages.sh | ||
|
||
WORKDIR /usr/local/share/tessdata/scripts | ||
|
||
COPY .tesseract/get-scripts.sh . | ||
COPY .tesseract/scripts.txt . | ||
|
||
RUN chmod +x ./get-scripts.sh | ||
RUN ./get-scripts.sh | ||
|
||
RUN apt-get -y install openjdk-21-jdk | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=app_stage /app/build/libs/ocr-studio.jar . | ||
|
||
CMD ["java", "-jar", "ocr-studio.jar"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.