Correctly use ENV vars for setting the production configurations

PR to master since this is a important fix for the production environment.