Wat
Uses the great implementation of Simon Braconnier JODconverter to offer LibreOffice as an Document-Converter Web-Service.
This docker image is a "all you need" and should help you running JODconverter as a WebApp utilizing the packaged LibreOffice for conversions. Ultimately this should be your "document conversion chain" service
To run this in a production-ready stack, please see the follow-up project eugenmayer/converter
Builds info
- Official OpenJDK 11 Java (since that is what we want with docker)
- Debian SID
- using glibc > 1.53 to fix CPU usage of LibreOffice
- LibreOffice is 6.1.5+ right now
Hint: We cannot split JODconverter and LibreOffice into two seperate images since for now, jodconverter has to be running on the same machine as LibreOffice. The main reason behind this is, that JODconverter does manage the LibreOffice instances itself, starts and stop them. It does not just connect to it (and if, it uses a local socket)
Run
Thats the variant with a web-GUI (see screenshot)
docker run --memory 512m --rm -p 8080:8080 eugenmayer/jodconverter:gui
Now you can connect to http://localhost:8080 with a nice web-ui for conversion
Or you pick the variant a REST interface only only
docker run --memory 512m --rm -p 8080:8080 eugenmayer/jodconverter:rest
Now go on http://localhost:8080/swagger-ui.html
to inspect the available endpoints. Docs under
For more please check the wiki at https://github.com/sbraconnier/jodconverter
To run this in a production-ready stack, please see the follow-up project eugenmayer/converter
Docker images
eugenmayer/jodconverter:base
- OpenJDK 11: libreoffice included, also start scripts but now actual applicationseugenmayer/jodconverter:gui
- OpenJDK 10 yet (see this issue): the WebGUI, spring based convertereugenmayer/jodconverter:rest
- OpenJDK 10 yet (see this issue) rest only variant
Configuration
You can configure the docker images by mounting /etc/app/application.properties
and put whatever you like into them.
For example if you like to have 2 LibreOffice instances, you would put into the file
# amount of libreOffice instances to start - one for each given port. So this means 2
jodconverter.local.port-numbers: 2002, 2003
# change the tmp folder
jodconverter.local.working-dir: /tmp
# change upload sizes
spring.servlet.multipart.max-file-size: 5MB
spring.servlet.multipart.max-request-size: 5MB
# change the server port (where the REST app is listenting
server.port=8090
Build youerself
make build
make start-gui
# or
make start-rest
now see above under "Run" how to access it
Credits
All of those please forward to sbraconnier's jodconverter - he does the real work :) And of course also credits to LibreOffice for actually giving us the headless mode and the conversion options in the first place