office-conversion: switch from jodconverter to collabora

This commit is contained in:
chandi 2024-11-24 16:31:25 +01:00
parent c740f55e5a
commit c298e051fc
3 changed files with 21 additions and 34 deletions

View File

@ -19,6 +19,7 @@ services:
- redis
- etherpad
- bbb-pads
- collabora
healthcheck:
test: wget --no-proxy --no-verbose --tries=1 --spider http://10.7.7.2:8090/bigbluebutton/api || exit 1
start_period: 2m
@ -298,21 +299,18 @@ services:
bbb-net:
ipv4_address: 10.7.7.32
jodconverter:
build: mod/jodconverter
image: alangecker/bbb-docker-jodconverter:latest
security_opt:
- 'no-new-privileges:true'
collabora:
image: collabora/code:latest
restart: unless-stopped
tmpfs:
- /tmp
deploy:
resources:
limits:
memory: 512M
networks:
bbb-net:
ipv4_address: 10.7.7.20
# disable logging (way to verbose)
logging:
driver: none
periodic:
build: mod/periodic

View File

@ -7,6 +7,8 @@ PATH="/bin/:/usr/bin/"
# Param 1: Input office file path (e.g. "/tmp/test.odt")
# Param 2: Output pdf file path (e.g. "/tmp/test.pdf")
# Param 3: Destination Format (pdf default)
# Param 4: Timeout (secs) (optional)
if (( $# == 0 )); then
echo "Missing parameter 1 (Input office file path)";
exit 1
@ -16,15 +18,19 @@ elif (( $# == 1 )); then
fi;
source="${1}"
dest="${2}"
source="$1"
dest="$2"
#If output format is missing, define PDF
# If output format is missing, define PDF
convertTo="${3:-pdf}"
curl -v -X POST "http://jodconverter:8080/lool/convert-to/$convertTo" \
-H "accept: application/octet-stream" \
-H "Content-Type: multipart/form-data" \
-F "data=@${source}" > "${dest}"
# If timeout is missing, define 60
timeoutSecs="${4:-60}"
# Truncate timeout to max 3 digits (as expected by sudoers)
timeoutSecs="${timeoutSecs:0:3}"
exit 0
# The timeout is important.
timeout $(printf %03d $timeoutSecs)s curl -F "data=@${source}" -k https://collabora:9980/cool/convert-to/$convertTo > "${dest}"
exit 0

View File

@ -1,17 +0,0 @@
FROM ghcr.io/jodconverter/jodconverter-examples:rest
RUN echo "ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true" | debconf-set-selections
RUN sed -i 's/main/main contrib/' /etc/apt/sources.list.d/debian.sources && apt-get update
RUN apt-get update && apt -y install --no-install-recommends \
fonts-arkpandora \
fonts-crosextra-carlito \
fonts-crosextra-caladea \
fonts-noto \
fonts-noto-cjk \
fonts-liberation \
fontconfig \
ttf-mscorefonts-installer
# avoid "APPLICATION FAILED TO START. Config data location '/etc/app/' does not exist"
# https://github.com/bigbluebutton/docker/issues/178
CMD ["--spring.config.additional-location=optional:/etc/app/"]