Skip to content

Commit

Permalink
build joex image
Browse files Browse the repository at this point in the history
  • Loading branch information
pschichtel committed Sep 15, 2024
1 parent 43c89d6 commit 107e227
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/container-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Container Images

on:
workflow_dispatch:
push:
branches:
- main
create:
tags:
- v*


jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build the Docker image
run: |
tag="${GITHUB_REF##*/}"
if [ "$tag" = 'main' ]; then tag='latest'; fi
image_name="ghcr.io/docspell/joex:${tag}"
docker build --cache-from type=gha --cache-to type=gha,mode=max -t "$image_name" .
docker push "$image_name"
48 changes: 48 additions & 0 deletions Dockerfile.joex
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
FROM ubuntu:oracular AS base


RUN apt update \
&& apt full-upgrade -y

RUN apt install -y \
$(apt list 2>/dev/null | grep 'tesseract-ocr-' | cut -d'/' -f1) \
tzdata \
openjdk-21-jre \
ghostscript \
unpaper \
weasyprint \
unoconv \
python3-distutils-extra \
fonts-droid-fallback \
fonts-dejavu \
fonts-freefont-ttf \
fonts-noto \
pngquant \
ocrmypdf \
qpdf

FROM base AS download

RUN apt install -y \
curl \
unzip

WORKDIR /opt

ARG DOCSPELL_VERSION

RUN curl -sLfo joex.zip "https://github.com/eikek/docspell/releases/download/v${DOCSPELL_VERSION}/docspell-joex-${DOCSPELL_VERSION}.zip" && \
unzip joex.zip && \
rm joex.zip && \
mv docspell-joex-* docspell-joex && \
rm docspell-joex/conf/docspell-joex.conf

FROM base

COPY --from=download /opt/docspell-joex /opt/docspell-joex

COPY joex-entrypoint.sh /opt/joex-entrypoint.sh

ENTRYPOINT ["/opt/joex-entrypoint.sh"]
EXPOSE 7878

7 changes: 7 additions & 0 deletions joex-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

echo "Starting unoconv listener"
unoconv -l &

/opt/docspell-joex/bin/docspell-joex "$@"

0 comments on commit 107e227

Please sign in to comment.