I am trying to put together a dev environment using ortussolutions/commandbox
and Docker compose. My setup uses server.json
to specify that I want to use Adobe 2021 instead of Lucee, and box.json
to install a number of packages and Testbox.
When I used this Docker compose service, with server.json
and box.json
in the same folder as docker-compose.yml
, this worked:
cfml:
image: ortussolutions/commandbox:alpine
container_name: cfml
volumes:
- type: bind
source: .
target: /app
ports:
- "8080:8080"
depends_on:
db:
condition: service_started
networks:
- main
environment:
- cfconfig_adminPassword=*********
However, I wanted to make the bind target the folder with my application, and not the parent folder that contains docker-compose.yml
. I got as far as this:
cfml:
image: ortussolutions/commandbox:alpine
container_name: cfml
volumes:
- type: bind
source: ${PWD}/app
target: /app/public
- type: bind
source: ${PWD}/configs/server.json
target: /app/server.json
- type: bind
source: ${PWD}/configs/.cfconfig.json
target: /app/.cfconfig.json
ports:
- "8080:8080"
depends_on:
db:
condition: service_started
networks:
- main
environment:
- cfconfig_adminPassword=*******
- BOX_SERVER_CFCONFIGFILE=/app/.cfconfig.json
With "web":{ "webroot":"/app/public" }
in server.json
.
The problem is that I can’t get it to use my box.json
file. Currently, I get an install with Adobe Coldfusion instead of Lucee (which is how I know that server.json
is being read), but none of the packages that I install with box.json
are installed.
Also, the datasource that I defined in .cfconfig.json
is present, but the mapping that I attempted to add is missing.
When I add it in CF Administrator, it is:
Logical path: /appname
Directory path: /app/public
In .cfconfig.json
, I added:
"mappings":{
"/appname": "/app/public"
},
I tried copying box.json
into the volume, both in /
and /app
, and putting it in the same folder as docker-compose.yml
, but it seems to be ignoring it no matter what I do with it.
Can you tell me how to get my service to use box.json
and add a mapping?