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)”
(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:
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 && \
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
$ docker run --rm -it lucee4-nodejs:latest which 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" />
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)"
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.