How to Setup a Excel Import Server on Linux
This Section describes how to setup a Excel Import Server on Linux.
1. Create an excelimport.service file in /etc/systemd/system/ directory, with the following content:
[Unit]

Description=Excel Import application

After=syslog.target network.target





[Service]

SuccessExitStatus=143





Type=simple





ExecStart=java -jar <CB install dir>/msoffice/cb-excel-import.jar --rest.import.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 excel import service
Run the following commands in the terminal:
1. sudo systemctl daemon-reload.
2. sudo systemctl start excelimport.
3. sudo systemctl status excelimport.
Excel Import service should be up and running, see the returned status message in the terminal:
excelimport.service - Excel Import application

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

Active: active (running) since Fri 2022-02-04 14:17:19 CET; 6s ago
Run the 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"; \

java $JAVA_OPTS \

-jar $jarFile \

--rest.import.maxRequests=<NUMBER OF PARALLEL REQUESTS>

--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 into rootfs directory.
5. Run docker build -t excelimport
6. Push it into the docker registry.
Docker compose
1. Create a docker-compose.yml file with the following content:
version: '2.1'





services:





excelimport:

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 Excel Import server.
Was this helpful?