How to Setup a Word Export Server on Linux
To setup a word export server, perform the following steps:
1. Create a wordexport.service file in /etc/systemd/system/ directory, with the following content:
[Unit]

Description=Word Export application

After=syslog.target network.target





[Service]

SuccessExitStatus=143





Type=simple





ExecStart=java -jar <CB install dir>/msoffice/cb-word-export.jar --rest.export.maxRequests=<NUMBER OF PARALLEL REQUESTS> --server.ssl.key-store-type=PKCS12 --server.ssl.key-store=<Path of your keystore>/keystore.p12 --server.ssl.key-store-password=<PASSWORD> --server.ssl.key-alias=<ALIAS> --security.require-ssl=true --server.port=443

ExecStop=/bin/kill -15 $MAINPID





[Install]

WantedBy=multi-user.target
How to start word import service
Run the following commands in the terminal:
1. sudo systemctl daemon-reload.
2. sudo systemctl start wordexport.
3. sudo systemctl status wordexport.
The Word Import service should be up and running, see the returned status message in the terminal:
wordexport.service - Word Export application

Loaded: loaded (/etc/systemd/system/wordexport.service; disabled; vendor preset: enabled)

Active: active (running) since Fri 2022-02-04 14:17:19 CET; 6s ago
Healthcheck URL: https://<your domain>/actuator/health
How to create a docker image
1. Create a dockerfile with the following content:
FROM adoptopenjdk/openjdk8:ubi # 21.09 and below

FROM adoptopenjdk/openjdk11:ubi # after 21.09





# Create user - End

RUN groupadd -g 1001 appuser && \

useradd -m -r -u 1001 -g appuser appuser

# Create user - End





# Setup user directory - Start

COPY rootfs /home/appuser/

# Setup user directory - End





RUN echo '\

jarFile=$(find /home/appuser/ -name \*.jar | head -n 1); \

echo "Run: java $JAVA_OPTS -jar $jarFile --rest.export.maxRequests=${MAX_REQUESTS:-3}"; \

java $JAVA_OPTS \

-jar $jarFile \

--rest.export.maxRequests=${MAX_REQUESTS:-3} \

--server.ssl.key-store-type=PKCS12 \

--server.ssl.key-store=/home/appuser/keystore.p12 \

--server.ssl.key-store-password=${PASSWORD} \

--server.ssl.key-alias=${ALIAS} \

--security.require-ssl=true \

--server.port=8443; \

' > /home/appuser/run.sh





RUN chmod +x /home/appuser/run.sh





HEALTHCHECK --interval=30s --timeout=3s --start-period=1m --retries=10 \

CMD curl -f --insecure https://localhost:8443/actuator/health || exit 1





WORKDIR /home/appuser

ENTRYPOINT [ "bash", "-c", "/home/appuser/run.sh" ]
2. Create a rootfs directory.
3. Copy the keystore.p12 file into rootfs directory.
4. Copy the cb-msoffice-integration-<version>.jar file into rootfs directory.
5. Run docker build -t wordexport.
6. Push it into the docker registry.
Docker compose
1. Create a docker-compose.yml file, with the following content:
version: '2.1'





services:





wordexport:

image: <YOUR IMAGE>

environment:

- "JAVA_OPTS=-XX:+HeapDumpOnOutOfMemoryError -XX:InitialCodeCacheSize=128m -XX:ReservedCodeCacheSize=128m -XX:+UseCodeCacheFlushing -Xss1m -Xms2500m -Xmx2500m"

- LOG4J_FORMAT_MSG_NO_LOOKUPS=true

ports:

- "443:8081"

volumes:

- /tmp:/tmp
2. Run docker-compose -f docker-compose.yml up -d to start Word Export server.
Was this helpful?