|The 'run' file must be an executable application.|
For a shell script, that means it must start with:
Thus you should be using:
You also should not be putting your 'app.py' file in the '.s2i/bin' directory. It should be in the root of the repo. That way it will be automatically copied to:
The question is though why you are even overriding the 'run' script. You can remove it as written, place your 'app.py' file in the root of the repo and the Python S2I will automatically find it in the /opt/app-root/src directory of the container and run it with Python for you.
I believe I already referred you to:
where the behaviour of the S2I builder image is explained.
You shouldn't usually need to override either 'assemble' or 'run' if you use the S2I images as intended.