It is unclear what you have done to try to troubleshoot this yourself?
You are deviating dramatically from the structure in the example repo. The Binder documentation tries to thoroughly dissuade you from using a Dockerfile, and so ideally you want to tread lightly and stick as close to the example as possible. (Or other closely-related examples shown to work, see below.) The example Dockerfile has it ending (lines 7 to 17) what is shown there. Pip installs go before that block. You have that block in the middle and broken up the last line with other stuff in between, namely pip installs. The example has them going first. Did you establish all that works first by removing everything you presently have after line 22 USER ${USER}?
There are a number of resources about running postgres in MyBinder that may help you with that part.
Examples:
- Running a PostgreSQL Server in a MyBinder Container – OUseful.Info, the blog… (related to that post: GitHub - ouseful-template-repos/binder-postgres: Example of running PostgreSQL in MyBinder / repo2docker , Running arbitrary services alongside Jupyter notebooks in Binderhub)
- Example mybinder postgresql server · GitHub