Configuring an existing server

So I’ve had a Lucee server setup in a Docker Compose created environment for some time, having multiple containers:


(and a few others)

My setup came long before CFConfig, and now I’m trying to streamline that setup, add new datasources, etc.

How do I “connect” cfconfig to my existing Lucee server? There’s a boatload of documentation out there, but I’m confused. Anybody out there that can give me a nudge?


Are you using the CommandBox based Ortus Docker images? If so, you don’t need to do much at all, it’s all baked in and you can pick it up with a simple environment arg. If you want to bake it into some image of your own, then you just need a build step that installs CommandBox and runs:

box install commandbox-cfconfig
box cfconfig import /path/to/myConfig.json /path/to/Lucee/Server/Home/Dir

The Ortus images support a crap ton more features than that (like one off settings by env var convention and setting admin passwords into the server and web context for you) but above is really all you need for the basics. Of course, the other big advantage to the Ortus image is that you’re using CommandBox to spin up the server itself so it’s reusing CommandBox for both and makes getting new versions really easy as well as wrapping up all your server settings in server.json which you can re-use for local dev too.

Yeah, I’m just using the standard lucee/lucee5 image. I was finally able to figure out the correct paths to hit to run commands, now I just have to figure out my timing for running the commands.

Is there a guide to the correct structure of a server.json and webcontext.json file somewhere? I’m still combing through the documentation.

Thanks for the answer back Brad.

Check out the CommandBox docs for the information on the server.json file:

All the specific bits are documented on the subsequent pages in the docs. As far as your question about webcontext.json I don’t know what that is. Are you referring to the CF Config JSON files? If so, check out the CFConfig docs.

Thanks Brad. I run a multi-host setup, where I previously defined three separate sites in my tomcat server.xml. Lucee would then create a separate server context for each site. I’m still trying to figure out the best way to automate this without hand tooling the server.xml and stuff. (that’s worked great for a while now, but trying to make it better)

I’m not aware of any ways right off to automate the server.xml stuff, but as you probably know, the Docker mindset is generally one app/site per image. So if you have three sites, you’d have 3 Docker images so you could spin them up and scale separately. And if the images need to come up together, this is a great use for Docker Compose.

Yeah, I’m trying to limit the number of images to small containers, since this is a personal thing and I’m paying out of pocket. I’m thinking I can use the docker-gen container I already have (for setting up letsencrypt certs on all my domains) to overwrite my server.xml and context lucee-web-xml.cfm files via templates

Well, keep in mind that the stock Lucee images that come from LAS have a hard coded web context folder so if you start more than one site in Tomcat, they’ll all share the same Lucee web context folder. Same with the Ortus images-- you could probably hack them, but they’re all built to have a single server/site/app in them.