Running soffice headless in a docker container

Hi, anyone knows how can we configure resources in a Docker Container that runs soffice headless.

Use case:

If I run the command soffice --headless conter-to pdf with the same docx file:

in a Standlone Server (VPS etc), localhost FULL OS (tested with centos, ubuntu, macos)

Successful conversion: docx [5039572b] to pdf in 123207ms

Aprox: 2minutes

using a docker container: (tested with centos and ubuntu)

Successful conversion: docx [5039572b] to pdf in 4789140ms

Aprox (78 minutes)

Reference: