Pdf2image performance issues in docker

Hi, I am using docker container for deploying my project into the server. I have some invoices automation solutions in which the pdf invoices are first converted into jpeg images using pdf2image python library. Then an OCR will detect the text and extract it. This is working perfectly in my local Ubuntu 20.04 machine. But when dockerise the source code and run it in server, there is some performance issues for pdf2image. Here the distance between the letters in a word is increasing and so OCR extract text differently. I tried with multiple versions of pdf2image but problem remaining same. Anybody can help me in this ?