This repository provides a sample Python web application implemented using the Flask web framework
This sample Python application relies on the support provided by the default S2I builder for deploying a WSGI application using the gunicorn WSGI server. The requirements which need to be satisfied for this to work are:
- The WSGI application code file needs to be named
wsgi.py. - The WSGI application entry point within the code file needs to be named
application. - The
gunicornpackage must be listed in therequirements.txtfile forpip.
In addition, the .s2i/environment file has been created to allow environment variables to be set to override the behaviour of the default S2I builder for Python.
- The environment variable
APP_CONFIGhas been set to declare the name of the config file forgunicorn.
- Linux RHEL
- python 3.6
- Flash???
-
To deploy this sample Python web application from the OpenShift web console,
python:3.7orpython:latest. -
Use the following git URL https://github.com/simple-best/os-sample-python.git
-
If using the
occommand line tool (cli) instead of the OpenShift web console, you can run:
oc sample_py_flask_app python:3.6~https://github.com/simple-best/os-sample-python.git
Note if no language type is specified, OpenShift will determine the language by inspecting the code repository.
- Because the code repository contains a
requirements.txt, it will subsequently be interpreted as including a Python application. - When such automatic detection is used,
python:latestwill be used.
- If you don't need to select a specific Python version you should instead use:
oc sample_py_flask https://github.com/OpenShiftDemos/os-sample-python.git