Deploying to Docker - .CFConfig and .jar files?

I’m having difficulty copying my .CFConfig.json and required .jar files over to an official Lucee docker image (lucee/lucee:6.2.1.122-nginx) so they can be used in Lucee for my application.

Copying .CFConfig.json:

I can deploy .CFConfig.json when I mount this file as a volume in my docker-compose.yml file like this:

volumes:
    - ./.CFConfig.json:/opt/lucee/server/lucee-server/deploy/.CFConfig.json

HOWEVER, since it’s a read only file when mounted this way, Lucee can’t move (or delete) it, so it keeps deploying it over and over again. The container uses a ton of resources doing this, and it never stops. So this doesn’t work.

Instead, I’ve been trying to copy my config file over to the Lucee deploy folder. From my Dockerfile, I call:

COPY ./.CFConfig.json /opt/lucee/server/lucee-server/deploy/.CFConfig.json

I don’t get any errors, but this doesn’t stick. The file is not there when I look at the files in the docker image, maybe because the deploy folder gets overwritten when Lucee starts for the first time?

I’ve even tried copying directly to the context folder and that also doesn’t work, even though it’s used as an example in the Docker examples.

./.CFConfig.json /opt/lucee/server/lucee-server/context/.CFConfig.json

Copying .jar Files:

I’m also confused as how to deploy .jar files. I was hoping that I could use the new maven feature in javasettings (Using Maven directly via CFML :: Lucee Documentation - I tried both in application.cfc and in my .CFConfig.json file), but this doesn’t load all dependencies, so instead I am trying to copy my fat .jar file over to the Lucee lib directory.

This doesn’t work either. Seems like I’m running into the same issue with copying files to the Lucee context prior to Lucee starting up. So even when I run:

COPY ./my-required-java.jar /opt/lucee/server/lucee-server/context/lib/my-required-java.jar

The .jar file doesn’t exist after Lucee runs for the first time.

Conclusion

From what I can tell, this is a timing issue. Maybe I need to let Lucee warm up first, and then copy the files over, and then Lucee again, but I have no idea how to do that when building an image.

Environment:

My environment is Windows 11, Docker Desktop, using the lucee/lucee:6.2.1.122-nginx image.

Java settings are currently lazy loaded on first use of the java classes, i.e new class() etc

Regarding the deploy folder

There is extensive logging around all this in 6.2.1

https://luceeserver.atlassian.net/browse/LDEV-5374

Lucee needs to be able to purge files in the deploy folder as it’s regularly polled, so we don’t want to be constantly reprocessing files

It sounds like somehow your lucee-server folder is being deleted before you deploy.

Can you share all your deploy scripting? It’s very hard to diagnose , i.e create a repo with an example

What’s in your deploy.log and out.log?

Here’s my Dockerfile:

FROM lucee/lucee:6.2.1.122-nginx
COPY ./.CFConfig.json /opt/lucee/server/lucee-server/deploy/.CFConfig.json

Can’t find a deploy.log file. Where would it be? Same place as out.log?

Can’t paste my out.log file bc it’s too large.

Also, it takes almost 4 minutes for Lucee to spin up. Here’s the terminal output:


Personal

Containers
www

www
fd11c90409ce
app-www:latest
8080:80⁠
STATUS
Running (1 minute ago)


2025-05-02 08:21:51,558 CRIT Supervisor is running as root. Privileges were not dropped because no user is specified in the config file. If you intend to run as root, you can set user=root in the config file to avoid this message.


2025-05-02 08:21:51,558 INFO Included extra file "/etc/supervisor/conf.d/supervisord.conf" during parsing


2025-05-02 08:21:51,568 INFO RPC interface 'supervisor' initialized


2025-05-02 08:21:51,568 CRIT Server 'unix_http_server' running without any HTTP authentication checking


2025-05-02 08:21:51,569 INFO supervisord started with pid 1


2025-05-02 08:21:52,573 INFO spawned: 'lucee' with pid 7


2025-05-02 08:21:52,582 INFO spawned: 'nginx' with pid 8


02-May-2025 08:21:53.295 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version name: Apache Tomcat/11.0.6


02-May-2025 08:21:53.299 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Apr 1 2025 14:40:40 UTC


02-May-2025 08:21:53.299 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version number: 11.0.6.0


02-May-2025 08:21:53.299 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Linux


02-May-2025 08:21:53.300 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 5.15.146.1-microsoft-standard-WSL2


02-May-2025 08:21:53.300 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64


02-May-2025 08:21:53.300 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /opt/java/openjdk


02-May-2025 08:21:53.300 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 21.0.7+6-LTS


02-May-2025 08:21:53.301 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Eclipse Adoptium


02-May-2025 08:21:53.301 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /usr/local/tomcat


02-May-2025 08:21:53.301 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /usr/local/tomcat


02-May-2025 08:21:53.314 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/usr/local/tomcat/conf/logging.properties


02-May-2025 08:21:53.314 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager


02-May-2025 08:21:53.314 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048


02-May-2025 08:21:53.315 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027


02-May-2025 08:21:53.315 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.lang=ALL-UNNAMED


02-May-2025 08:21:53.315 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.lang.reflect=ALL-UNNAMED


02-May-2025 08:21:53.315 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.io=ALL-UNNAMED


02-May-2025 08:21:53.315 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.util=ALL-UNNAMED


02-May-2025 08:21:53.316 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.base/java.util.concurrent=ALL-UNNAMED


02-May-2025 08:21:53.316 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED


02-May-2025 08:21:53.316 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: --enable-native-access=ALL-UNNAMED


02-May-2025 08:21:53.316 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xms512m


02-May-2025 08:21:53.316 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx1g


02-May-2025 08:21:53.316 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:MaxMetaspaceSize=256m


02-May-2025 08:21:53.317 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.security.egd=file:/dev/./urandom


02-May-2025 08:21:53.317 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/usr/local/tomcat


02-May-2025 08:21:53.317 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/usr/local/tomcat


02-May-2025 08:21:53.317 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/usr/local/tomcat/temp


02-May-2025 08:21:53.321 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded Apache Tomcat Native library [2.0.8] using APR version [1.7.2].


02-May-2025 08:21:53.328 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 3.0.13 30 Jan 2024]


02-May-2025 08:21:53.727 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8888"]

Try stopping, deleting the whole lucee-server directory and starting to get a fresh install and set of logs

Or docker compose down
Or docker compose --build in docker land

Yup, deploy.log is next to out.log

Sounds like possibly a permissions issue or you are using volumes incorrectly

What does your docker compose look like?

1 Like

Thank you @Zackster for pointing me in the right direction. The problem was that I was mapping the /opt/lucee/ folder so that I could have easy access to the logs and Lucee context.

1 Like