mirror of
https://github.com/sismics/docs.git
synced 2024-11-14 18:27:58 +01:00
Dockerization + Fix for Tesseract 3.03
This commit is contained in:
parent
18cedaef2c
commit
192c2030d3
10
Dockerfile
Normal file
10
Dockerfile
Normal file
@ -0,0 +1,10 @@
|
||||
FROM sismics/debian-java7-jetty9
|
||||
MAINTAINER benjamin.gam@gmail.com
|
||||
|
||||
RUN apt-get -y -q install tesseract-ocr tesseract-ocr-fra
|
||||
|
||||
ENV TESSDATA_PREFIX /usr/share/tesseract-ocr
|
||||
ENV LC_NUMERIC C
|
||||
|
||||
ADD docs-web/target/docs-web-*.war /opt/jetty/webapps/docs.war
|
||||
ADD docs.xml /opt/jetty/webapps/docs.xml
|
@ -53,7 +53,7 @@ public class Tesseract {
|
||||
private static Tesseract instance;
|
||||
private final static Rectangle EMPTY_RECTANGLE = new Rectangle();
|
||||
private String language = "eng";
|
||||
private String datapath = "tessdata";
|
||||
private String datapath = null;
|
||||
private int psm = TessAPI.TessPageSegMode.PSM_AUTO;
|
||||
private boolean hocr;
|
||||
private int pageNum;
|
||||
|
5
docs-docker-data/Dockerfile
Normal file
5
docs-docker-data/Dockerfile
Normal file
@ -0,0 +1,5 @@
|
||||
FROM busybox
|
||||
VOLUME ["/var/docs"]
|
||||
ADD data /var/docs/
|
||||
RUN chown -R 1001:1001 /var/docs
|
||||
CMD ["/bin/sh"]
|
3
docs-docker-data/build.sh
Normal file
3
docs-docker-data/build.sh
Normal file
@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
|
||||
docker build -t sismics/docs_data .
|
3
docs-docker-data/run.sh
Normal file
3
docs-docker-data/run.sh
Normal file
@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
docker rm -f sismics_docs_data
|
||||
docker run --name sismics_docs_data sismics/docs_data
|
10
docs.xml
Normal file
10
docs.xml
Normal file
@ -0,0 +1,10 @@
|
||||
<Configure class="org.eclipse.jetty.webapp.WebAppContext">
|
||||
<Set name="contextPath">/</Set>
|
||||
<Set name="war"><SystemProperty name="jetty.data" default="."/>/webapps/docs.war</Set>
|
||||
|
||||
<Call class="java.lang.System" name="setProperty">
|
||||
<Arg>docs.home</Arg>
|
||||
<Arg>/var/docs</Arg>
|
||||
</Call>
|
||||
|
||||
</Configure>
|
7
run-service.sh
Normal file
7
run-service.sh
Normal file
@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
docker rm -f sismics_docs
|
||||
docker run \
|
||||
-d --name=sismics_docs --restart=always \
|
||||
--volumes-from=sismics_docs_data \
|
||||
-e 'VIRTUAL_HOST_SECURE=docs.sismics.com' -e 'VIRTUAL_PORT=80' \
|
||||
sismics/docs:latest
|
Loading…
Reference in New Issue
Block a user