Correct on the 3 problems.
Youâd essentially have to create your own derivative docker container for lucee. From your post Apr 20 youâre using Lucee 4.5? I know there were cfexecute items fixed in Lucee 5.3 but I have no idea about Lucee 4.5. (insert usual response here on 4.5 isnât supported, people arenât going to have experience with it, the container isnât being updated, you should really be on 5, blah blah blah)
Lets figure out what the container is using assuming yourâe using lucee/lucee4:latest
$ docker run --rm -it lucee/lucee4:latest cat /etc/os-release
PRETTY_NAME=âDebian GNU/Linux 9 (stretch)â
NAME=âDebian GNU/Linuxâ
VERSION_ID=â9â
VERSION=â9 (stretch)â
ID=debian
HOME_URL=âhttps://www.debian.org/â
SUPPORT_URL=âhttps://www.debian.org/supportâ
BUG_REPORT_URL=âhttps://bugs.debian.org/â
Cool, stretch.
https://github.com/nodesource/distributions#deb
(note that Node 8 is old too)
That page says to do
Using Debian, as root
curl -sL https://deb.nodesource.com/setup_8.x | bash -
apt-get install -y nodejs
So we do that in a Dockerfile.
I.e. create a Dockerfile in a new, empty directory:
FROM lucee/lucee4:latest
RUN apt-get update && \
apt-get install -y --no-install-recommends curl && \
curl -sL [https://deb.nodesource.com/setup_8.x](https://deb.nodesource.com/setup_8.x) | bash - && \
apt-get install -y nodejs && \
apt-get clean
Now:
docker build -t lucee4-nodejs:latest .
Itâll go through and do the install and return a âSuccessfully built âŚâ line.
Verify the results:
$ docker run --rm -it lucee4-nodejs:latest nodejs --version
v8.16.0
$ docker run --rm -it lucee4-nodejs:latest which nodejs
/usr/bin/nodejs
Replace your current docker run (or docker-compose) image for your lucee server with lucee4-nodejs:latest and restart the container.
now FileExists(â/usr/bin/nodejsâ) should return true, and you can cfexecute things.
Personally were I to use cfexecute Iâd ensure my arguments were properly encapsulated in an array. i.e.
<cfset args = [ "/path/to/my/file.js", "arg1", "arg2", "arg3" ] />
<cfexecute name="/usr/bin/nodejs" arguments="#args#" timeout="10" variable="nodeOut" errorVariable="nodeErr" />
or similar.
Be sure the paths you enter are for the CONTAINER, not the host. (i.e. if /home/youruser/lucee5/allapps is mapped to /app, you want /app instead)
If youâre using Lucee 5âs nginx container itâd be the same process.
From the 5.2 container:
docker run --rm -it lucee/lucee52-nginx:latest cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=debian
HOME_URL="[https://www.debian.org/](https://www.debian.org/)"
SUPPORT_URL="[https://www.debian.org/support](https://www.debian.org/support)"
BUG_REPORT_URL="[https://bugs.debian.org/](https://bugs.debian.org/)"
Also based on stretch. So the above Dockerfile is correct, just change the from line.
Also note that once you do this, youâre responsible for periodically rebuilding your container if the source container updates. (Currently youâd just docker pull and restart your container, instead, youâd now need to docker pull and if a new version is pulled, rebuild your LOCAL lucee4-nodejs:latest or lucee52-nodejs:latest or whatever you want to call it)
The better way to do this would be to use a more microservices based approach. If your node app is based on the command line, youâd wrap it in a HTTP wrapper or a unix socket based wrapper and use a volume mount to compose your services together. (i.e. use nodejsâs Express to attach a HTTP api. Or use something like fcgiwrap and use a fastcgi socket. Or something like ucspi-unix) Then updates for each container happen independently. That may be beyond your abilities at the moment. I canât give more specifics without knowing exactly what youâre trying to accomplish and how the pieces are built.