Improve docker script for LDAP

Move config env to top.
Use better method to get container IP