This is a docker container which with a pre-installed Python 2.7, cx_Oracle module and Oracle XE 12.1 client.
FROM devilrancy/robot_cx_py27
COPY yourapp.py /code/app.py
$ docker build -t my-python-app .
$ docker run -it --rm --name my-web-app my-python-app
Local volume where app resides must have a main application whose name is app.py
docker run -it --rm --name my-python-app -v "/my/local/path/":/code devilrancy/robot_cx_py27
from flask import Flask
import cx_Oracle
app = Flask(__name__)
app.debug = True
@app.route('/hello')
def hello():
return 'Hello World! Running with Oracle!'
if __name__ == "__main__":
app.run(host="0.0.0.0", debug=False)
docker run -it --rm --name my-python-app -p 5500:5000 -v `pwd`:/code sbanal/python-oracle-xe12.1-latest
Example http://192.168.99.100:5500/hello