Quantcast
Channel: Lucee Dev - Latest topics
Viewing all articles
Browse latest Browse all 536

Deploying to Docker - .CFConfig and .jar files?

$
0
0

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.

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 536