I am trying to run commandbox in a docker for wind...
# box-products
m
I am trying to run commandbox in a docker for windows container. FROM mcr.microsoft.com/windows/servercore:ltsc2019 (Dockerfile) files copied to container (pseudo code): c:\\commandbox - jre - box.exe c:\\app - index.cfm ("Hello World)" - server.json { "web":{ "rewrites":{ "enable":true }, "http":{ "port":"8500" } }, "jvm":{ "heapSize":"1024" }, "app":{ "cfengine":"lucee" } } WORKDIR c:\\app
docker run -it -p 8500:80 --name cf_helloworld_container cf_helloworld_image
then inside the windows container I run: PS C:\app> box install commandbox-cfconfig PS C:\app> box CommandBox> start CommandBox> server open Opening...127.0.0.1:8500/ Browser opened! in the host browser -> localhost:8500 (This site can't be reached) Q: do I need to configure "mysite" in the container's IIS to render in the host browser? Thanks - Marco
b
There's really a LOT of missing information here
I would map your external port through directly to CommandBox's HTTP port and skip IIS entirely
But, if you're wanting to use IIS, then yes.. you'll need to configure that 🙂
m
How do you map the port with commandbox? in the server.json?
b
You're already telling CommandBox what port to use
Copy code
"http":{
            "port":"8500"
        }
So just expose that port in the container and be done is what I'm saying
but it looks like instead, you're exposing the internal port of 80 as 8500 externally
but that obviously isn't' going to allow you to hit CommandBox unless you've got whatever is listening on port 80 (presumably IIS) proxying through to box
m
Brad do you have a simple commandbox example that runs in a window container? send my a link if you find one, thanks
b
No, never used Windows docker
And I wouldn't recommend it, lol
Unless you're married to an IIS specific feature or some other Windows-specific behavior
CommandBox even has a setting to force static files to be case insensitive to help you ease into Linux 🙂
But generally speaking, I don't think setting up CommandBox on Windows inside of Docker is going to be that different from setting up CommandBox in Windows in general.