Lucee on Docker - Setting Defaults


#1

I am using the base lucee/lucee-tomcat image from docker to spin up
instances on google cloud. As part of my Dockerfile I would like to set
the following 3 things:

  1. Lucee Server Password
  2. Lucee (default context) Web Password
  3. Lucee Web Timezone

Where are the easiest places to set these things?
Can they be set on the filesystem?
Or Can I add code to my application.cfc to set these things?

Thanks,
Greg


#2

All three of those things can be set in the config files, so essentially
you can do it the same way to the lucee-tomcat Dockerfile configures
itself. Have a copy of the lucee-server.xml and lucee-web.xml.cfm files
sitting next to your Dockerfile, and then in your Dockerfile you will add a
couple of commands to copy the files in to the container when it is built:

COPY lucee-server.xml 
/opt/lucee/server/lucee-server/context/lucee-server.xml
COPY lucee-web.xml.cfm /opt/lucee/web/lucee-web.xml.cfm

An easy way to configure those files is to just use the Lucee admin. Run
your container and log in to the Admin and configure everything you need
(including passwords). After that is done you can copy those files out of
the container on to your host using “docker cp”:

https://docs.docker.com/reference/commandline/cp/

If you need to make more changes in the future you can do the same thing
again – configure it in the Lucee admin, then copy the files out of the
container and put them with your Dockerfile.

cheers,
Justin


#3

Just following on from Justin’s advice…

An example of a working development environment using Docker and passing in
configs via COPY available here:

Daemon use projects structured like this to set up a working dev
environment and a deployment pipeline for Docker apps.

Hopefully with Lucee 5 we will have more options with respect to server
configuration via ENV variables.


#4

Thanks guys, I got everything working.

Docker is awesome.

If you haven’t seen googles container engine on google cloud I highly
recommend checking it out. I like it better than elastic beanstalk and the
google servers are now cheaper than AWS for the most part. They way
they’ve done the clustering is awesome and unbelievable scalable.

I now run docker-compose on local dev, and gcloud deployment with
kubernetes and it works awesome. They’re got super easy to use command
line tools that make deployment so seemless its incredible. You can even
mout volumes that are active gitRepo’s (not doing this for production but
its nice for shared test enviornments).

Hopefully Lucee will continue to provide great docker support.


#5

Docker is awesome.

+1 :heart:

If you haven’t seen googles container engine on google cloud I highly
recommend checking it out. I like it better than elastic beanstalk and the
google servers are now cheaper than AWS for the most part. They way
they’ve done the clustering is awesome and unbelievable scalable.

We use Tutum.co for miscellaneous apps (it runs Docker on AWS,
DigitalOcean, Softlayer, and others), and Mesos/Marathon for larger wholly
managed node clusters (10+ servers). Am very interested to see Google
getting their act together in this area.

Hopefully Lucee will continue to provide great docker support.

We plan to do great things :slight_smile: If you have any feature requests and/or
suggestions please raise them here:


#6
  1. Lucee Web Timezone

The timezone can be set in your Application.cfc, eg:

this.timezone = "UTC";

#7

I hadn’t looked into Tutum before, it looks pretty cool and also very
similar to Kubernetes as far as deployment and cluster scheduling, but a
little bit more cloud agnostic. Thanks for sending this over, I just
created an account and look forward to digging in a bit deeper.