- You should have Docker installed.
- You should have tesseract-server up and running.
- You should have php (tested with php 7.3, php 7.4, php 8.0 & php 8.1).
- You should have tesseract-server up and running.
docker run --name tesseract-ocr-server-web-ui -d --restart unless-stopped -v <config_path>:/app/config -p <port>:8080 ghcr.io/m-primo/tesseract-ocr-server-web-ui:latestReplace <config_path>, with the app configuration path.
Replace <port>, with the port you want the app to listen on.
After this, start from step number 4 in From Source.
-
Clone this repository:
git clone https://github.com/m-primo/tesseract-server-ui.git
-
Build the Docker image:
docker build -t tesseract-ocr-server-web-ui . -
Run the Docker container (edit whatever you want):
docker run --name tesseract-ocr-server-web-ui -d --restart unless-stopped -v <config_path>:/app/config -p <port>:8080 tesseract-ocr-server-web-ui
Replace
<config_path>, with the app configuration path. Replace<port>, with the port you want the app to listen on. -
Create a Docker network to connect both containers to each other:
docker network create tesseract-network
-
Attach the network to the
tesseract-servercontainer (replace<tesseract-server-container-id>with thetesseract-servercontainer id):docker network connect tesseract-network <tesseract-server-container-id>
-
Attach the network to the
tesseract-ocr-server-web-uicontainer:docker network connect tesseract-network tesseract-ocr-server-web-ui
-
Get the IP of the
tesseract-servercontainer (replace<tesseract-server-container-id>with thetesseract-servercontainer id):docker inspect <tesseract-server-container-id>
Then scroll to the very down of the response until you see an object called
Networksand inside it another object calledtesseract-network.Copy the value of a key called
"IPAddress". It should be like this172.18.0.2. Copy it. -
Edit
config.phpto match the container IP you just copied. The finalconfig.phpshould like this (notice that8884is the internal port of thetesseract-serverport, not the port you exposed it):<?php $config = [ 'url' => 'http://172.18.0.2:8884', 'timeout' => 0, // 0 to disable ]; define('CFG', $config); ?>
-
Clone this repository:
git clone https://github.com/m-primo/tesseract-server-ui.git
-
Edit
config.phpto match the tesseract server host & port. The finalconfig.phpshould like this:<?php $config = [ 'url' => 'http://127.0.0.1:8884', 'timeout' => 0, // 0 to disable ]; define('CFG', $config); ?>
-
Run the web ui with the PHP built-in development server (replace
<host>with destination host -usually 127.0.0.1 or 0.0.0.0-, and<port>with any port you want):php -S <host>:<port> -t ./app
