I am using flask to serve my application. I am connecting oracle 19c database using session pooling. And my wsgi server is bjoern. It runs extremely fast on Ubuntu 20.04. I am not an expert but maybe this will give you some idea.
My Dockerfile is like:
# syntax=docker/dockerfile:1
FROM python:3.9.9-buster
WORKDIR /opt/oracle
RUN apt-get update && apt-get install -y libaio1 wget unzip \
&& wget https://download.oracle.com/otn_software/linux/instantclient/1913000/instantclient-basic-linux.x64-19.13.0.0.0dbru.zip \
&& unzip instantclient-basic-linux.x64-19.13.0.0.0dbru.zip \
&& rm -f instantclient-basic-linux.x64-19.13.0.0.0dbru.zip \
&& cd /opt/oracle/instantclient* \
&& rm -f *jdbc* *occi* *mysql* *README *jar uidrvci genezi adrci \
&& echo /opt/oracle/instantclient* > /etc/ld.so.conf.d/oracle-instantclient.conf \
&& ldconfig
RUN apt-get install -y libev-dev
RUN apt-get install -y build-essential
RUN pip3 install flask
RUN pip3 install cx-Oracle
RUN pip3 install bjoern
RUN pip3 install Flask-HTTPAuth
WORKDIR /sapsrv
COPY . .
EXPOSE 5001
CMD ["python3", "srv.py"]
And my srv.py is like:
from flask import Flask, jsonify, make_response
import bjoern
import cx_Oracle
app = Flask(__name__)
if __name__=="__main__":
bjoern.run(app, "0.0.0.0", 5001)