When you want pass a parameter to exec docker instruction, you must used
#!/bin/bash
export variable="value second parameter"
export log=./log
docker exec -i dockernamecontainer /bin/bash <<EOF > $log/logfile.log 2>&1 &
cd /python/; python app.py firstparameter "$variable"
exit
EOF
the $variable is interpreted by
value second parameter