if production servers aren't running with commandb...
# adobe
j
if production servers aren't running with commandbox, can commandbox-dotenv still be utilized?
b
Used for what exactly?
It can be used for CommandBox commands you may use such as loading CFConfig into a server prior to starting it, but it's not going to be able to load env vars into a server that CommandBOx isn't starting
There did used to be a coldbox env module somewhere on forgebox that would load coldbox settings from a .env file-- not quite the same as env vars, but similar.
j
Well I'd love to use dotenv locally, but staging and prod servers are not set up with CommandBox so was wondering what sort of additional setup I'd need to do. Maybe I'll look for that old coldbox module
thanks
b
You can manually configure your server to have "real" env vars and your code will access them in the same manner, but when you're not using Docker or LInux in general, env vars are bit more of a pain to setup.
j
Yeah was hoping there was a quick way to set that up
b
Well, you could add something to the CF bootstrap, but I'm not even sure that's possible on a Windows machine when CF is just setup as a service
On a linux box, there is usually some sort of shell script which actually starts CF and you can set env vars directly in there, but I'm not even sure what the windows services actually call, perhaps a tomcat binary directly
e
CommandBox DotEnv was always meant mainly as a development tool where you needed to scope env vars per project and not per instance. In a production environment normal env vars usually work since there is only one running CFML instance as opposed to development where that are several to dozens.
❤️ 1
That coupled with the idea that the
.env
file should never be committed to source control, you’d be creating those env vars on the production server anyway.
👍 1