Best practices for .CFConfig.json management

RE: Lucee 6.2.6.19

I’m currently managing a .CFConfig.json assembly process that starts with a base file with all common settings across all environments, and I merge things like datasources, caches, settings, etc for each environment where my app is run. My environments are Docker (local), testing and blue/green production on AWS.

I’m running into .CFConfig.json management issues as my settings change over time. For example, I just enabled the memcached extension, and I setup my session cache to use it. The way I did it was to install the memcached extension locally via the lucee admin, and then I copied/pasted the changes to .CFConfig.json. This is obviously not a great way to do it because it requires that I find the changes and manually move them to my .CFConfig.json file(s). Manual = mistakes and omissions.

How are people managing their server configurations over time? Should I be installing extensions using the deploy folder? Or can I specify that Lucee needs to install a list of extensions so that I don’t have to track those settings in my .CFConfig.json?

OS: Ubuntu 24.04 (Noble)
Java: OpenJDK 21
Tomcat Version: 11.0.6
Lucee Version: 6.2.6.19

Here’s the docs

With docker, copying into deploy works quite well, but for blue green deployments, please be a good nenizen and always cache / use a proxy for such artifacts on build, rather than hitting the cdn every deployment, which is also faster!

(this is example rarely deployed, hence no caching)

1 Like

Thanks… what I learned the most is that my .CFConfig.json file does not need to be complete. I can leave out Lucee defaults.

I think I’m wrong that Lucee only adds to it’s configuration when you add a .CFConfig.json to the deploy directory. I’ve had numerous problems importing my .CFConfig.json file via the /deploy directory where the file contained only the changes I needed from the defaults. Eventually, I ended up starting from scratch by having Lucee create a brand new .CFConfig.json (ran first time without any changes, copied file), and then I used that as my base. Then I manually re-added the changes I needed, and my problems were solved. So I’m guessing Lucee 6.2.6.19 was not happy with my .CFConfig.json file, even though I didn’t see any issues in the deploy.log file.

What was happening is that Lucee imported some of my config settings while leaving Lucee in a bad state. I was not able to open the Lucee administrator, and there were lots of weird issues with resourceProviders not existing, etc.

In the process of working on this problem, I discovered that including dependencies in the javasettings.maven array can cause major problems if Lucee cannot download and deploy those dependencies. In such cases, I didn’t see anything in log files that would indicate that Lucee had problems with these dependencies, so it took a while to figure out what was going on. I eventually built a tool that deploys my java dependencies as a separate process.

It would be wonderful if there was a tool that would help with managing .CFConfig.json files. I realize that commandbox cfconfig has some features that may help, but I’m not sure if that’s the answer. Perhaps it could, but I’m not sure how it would work in my development/production pipeline.

Any insights are welcome. Thank you in advance!