added ability to configure database and secret key via environment variables