Lucee Docker Launcher (Announce)

Hi lovely Lucee peeps!

Been a while in which I shared some of the things I do with lucee, so I thought I would share a simple script I use to launch lucee from whichever folder I am in.

I got tired of doing

docker run --rm --name lucee_launcher -v ${PWD}:/app -p 3000:8080 lucee/lucee:5.4.7.1-SNAPSHOT

or waiting for box to start and then I can start typing. The whole thing breaks my flow.

Anyway, wanted to share it if it helps!

I can now do

cd webroot
lucee

And I have a lucee server running at http://localhost:3000

Cheers!

Keep on Lucee-ing!

18 Likes

Very cool! I keep telling myself that I have to learn Bash one of these days—it looks like chicken-scratch (when compared to newer languages). But, I totally get that you don’t want to have to depend on something like Node to be in the path.

Rock on with your bad self!

3 Likes

Hi Mark, just wanted to show how I use Docker compose for a similar startup process on my development machine.

cd theproject
docker compose -f docker-compose-dev.yml up

The neat thing about this is that docker compose starts multiple container and sets up internal dns so that internally to the container for the services. So “web” can be accessed at “https://web:8543” or “https://pdf:6632”. Lucee admin is ready to go at http://web:8588/lucee/admin/index.cfm

(docker-compose-dev.yml)

services:
  web:
    build: .
    ports:
      - "9580:80"
      - "9588:8888"
      - "9543:443"
      - "95:9001"
    volumes:
      - /private/var/lib/appdev/sites/theproject/logs:/opt/lucee/server/lucee-server/context/logs
  pdf:
    image: "gitlab.internaldomain.com:4567/experimental/puppeteer-pdf"
    ports:
      - "6632:3000"

Hey Mark, thank you for sharing this! Yeah, using docker or commandbox commands are nice, but not nearly as easy as running ./lucee. Cheers, Bill

1 Like

Yep, that works! But the goal of my little script is that any folder can be the webroot. In your case you have a specific folder etc. Once I am at that stage I would setup things properly with a compose.yml file etc.

1 Like

Hey Mark, I know this post is months old, but I wanted to say thanks again for your script.

Very handy for running lucee directly from any directory.

On my Mac… I add the script to each project, set the defaults including env variables, then run…

./lucee.sh

I changed the Lucee docker port to 8888, and added a line that opens a browser tab (cuz I’m lazy).

No need to run CommandBox, no need to write a docker command, it just works.

Outside of your delightful script, I solved the process of adding a rewrite valve to a Lucee docker image.

Rewrites are now handled in a simple rewrite.config file, rather than messing with CommandBox or Nginx. Let’s just say it follows the Tomcat way of doing things.

Just an idea, it might be good for Lucee to include the rewrite valve in the server.xml file by default. Unless of course there are reasons against it.

Cheers.

1 Like