'How to connect cx_oracle in python microservice hosted on docker?

I have a microservice available on docker container , and I want to connect it with cx_oracle. Here is what my docker file looks like

FROM nvidia/cuda:11.2.2-cudnn8-runtime-ubuntu18.04  
RUN apt update &&  apt upgrade -y
RUN apt install -y python3 python3-pip
RUN apt install -y python3 python3-pip libnvvm3 cuda-toolkit-11-2

WORKDIR /app
ADD . /app
RUN pip3 install --upgrade pip
RUN pip3 install gunicorn==20.1.0
RUN pip3 install -r req.txt
EXPOSE 5002
CMD ["gunicorn", "-b", ":5002", "fwsgi:app", "--timeout", "3000", "--workers", "1"]

i have installed oracle instant client and added cx_oracle in my req.text here is my library path LIBRARY_PATH=/opt/oracle/instantclient_19_8 what changes should i do in my docker file to make it work? can i use two FROMs in a single docker file and if yes then will they be merged as a single image?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source