Determine port based on environment