Trying to get FusionReactor running on a docker co...
# box-products
s
Trying to get FusionReactor running on a docker container (using the official commandbox docker image). I've forwarded local port 8088 to 8088 on the container, my server.json has fusionreactor.enable=true and license & cloud group info. But I get nothing at 8088. And the instance does not show up in my FR Cloud group which makes me think FR is not running at all. Am I missing something? Do I need to box install commandbox-fusionreactor each time I launch the container?
b
@seandaniels You only need to install the module once, when building the image
The first place to start is the console output of the container as it starts
Does it show FR loading?
s
No
OK, so in my Dockerfile I add something to install the module?
b
Then it's not installed πŸ™‚
s
I've scoured the docs but can't find that little nugget
b
How did you install it before in Docker?
I'm confused because your first question sounded like you had already installed it but wasn't sure if you needed to install it again
now you're asking how to install it?
s
Sorry, I am totally new to the Docker thing. I have not installed it in Docker no
I guess I thought maybe the commandbox image already had it
b
OK, no worries. So there's many ways to start a docker image. Do you have β€’ a docker-compose file? β€’ a docker file you're using to build an image β€’ just a
docker run
command?
s
I'm using compose, which has a reference to a Dockerfile in the build: section
b
A custom docker file of your own design which is
FROM
the CommamdBox image?
s
correct
b
Or you're just directly starting the Ortus image up and mapping in your code into app?
s
My dockerfile looks like this, and in the compose file I'm mapping my app into /app
b
If you have your own DockerFile, then just add
Copy code
RUN box install commandbox-fusionreactor
and it will get installed when you build the image
s
Copy code
FROM ortussolutions/commandbox
ENV LUCEE_EXTENSIONS "E6634E1A-4CC5-4839-A83C67549ECA8D5B;name=MongoDB;version=3.12.8.133"

# Warm up the server with a specific version of CF Engine version. To see which
# versions are available on Forgebox run:
#   box forgebox search "Lucee CF Engine"
ENV BOX_SERVER_APP_CFENGINE=lucee@5.3.9+166
ENV BOX_SERVER_PROFILE=development
RUN ${BUILD_DIR}/util/warmup-server.sh
Perfect! That's the missing link I think πŸ™‚
πŸ‘ 2
Thank you!
b
Should get you there.
The rest of the bits you can add into your
server.json
or an env var
πŸ‘ 1
such as the license key
s
Does it default to port 8088?
Or do I need to add that to server.json
b
You'll want to add a port
CommandBox never assumes a default port for anything (except AJP)
So FR will be on a random port
which for local dev doesn't matter, but for Docker won't work since you need to expose the port
πŸ‘ 1
s
OK, right. Cuz you can run multiple servers
b
You can also enable the "external" FR server and hit it as
Copy code
normalHostName/fusionreactor/
but I don't like that for production
s
Yep, I did read about that when I was looking for the syntax for setting the port
j
@seandaniels 8080 is the default internal port for http inside of the container. Map 8080:8080 and you should be able to hit it
s
Got it working. However, if I switch my FROM to an alpine based image
FROM ortussolutions/commandbox:lucee5-alpine
, it looks like the installation of the module fails, and FusionReactor fails to start when I start the container. Is this a known issue?
j
I’ve never tried FusionReactor on an Alpine container before, so it’s quite possible there could be issues.
πŸ‘ 1
Feel free to report any issues in the GitHub repo: https://github.com/ortus-solutions/docker-commandbox
s
Right on, thanks