With Play 1.2, I can prefix the configuration keys with the framework ID or application mode as follows:
# Production configuration
%prod.http.port=80
%prod.
I have had this question for a long time as well and below is the best approach I've learned so far, I got a hint when asking a similar question on the Play 2 google group.
In you application.config use the following syntax to override a configuration value when a system parameter is present:
# Local machine fallback URI
mongodb.uri="mongodb://192.168.56.101:27017/application"
# Env variable override
mongodb.uri=${?MONGOLAB_URI}
The question mark means that you don't override with the env variable if it is not set. If you just use ${MONGOLAB_URI} you expect the variable to be set and, I assume, you get an exception of some kind if it is not set.
For completeness, here is an example of how you'd read the value:
lazy val mongoUri = current.configuration.getString("mongodb.uri").getOrElse("mongodb:///")
With this approach there is one caveat: make sure you keep your system param configuration in a SCM of some kind.