Docker and Compose declarations

Best DMX community,

please allow me to share two concept studies that show how to run DMX in a dockerized environment.

This is work in progress, and cannot be considered a production-ready setup and is shared here purely for educational purposes.

Is anybody using a similar configuration, and has tips how to move on from here?

Thanks in advance,

Jon

Hi @yala! A warm welcome to DMX and many thanks for sharing your work here!
Just recently we also started to work on creating a dockerized version of DMX, which is still at development stage and therefore was not published yet.

Being relatively new to the topic I am still struggling with some issues, especially handling the config.properties file. I want to share with you, where we are at, so that together we may find the best solution for it.

Dockerfile

FROM openjdk:8-jre-alpine
WORKDIR /opt/dmx-5.0.1
# log, conf, filedir and database are persisted on the docker host.
VOLUME ["/opt/dmx-5.0.1/logs"]
VOLUME ["/opt/dmx-5.0.1/dmx-db"]
VOLUME ["/opt/dmx-5.0.1/dmx-filedir"]
VOLUME ["/opt/dmx-5.0.1/bundle-deploy"]
VOLUME ["/opt/dmx-5.0.1/conf"]
COPY dmx-5.0.1 .
COPY dmx-5.0.1/conf/*.properties /tmp/
CMD [ ! -f /opt/dmx-5.0.1/conf/config.properities ] \
    && cp /tmp/*.properties /opt/dmx-5.0.1/conf/ \
    && /usr/bin/java -Xms256m -Xmx512m -Dfile.encoding=UTF-8 \
    -Dfelix.system.properties=file:/opt/dmx-5.0.1/conf/config.properties \
    -Dhost_url=${DMXURL} -jar /opt/dmx-5.0.1/bin/felix.jar
EXPOSE 8080

build the image

docker build --no-cache --tag dmx:5.0.1 .

run the container

docker run \
    --volume $(pwd)/dmx-docker/logs:/opt/dmx-5.0.1/logs \
    --volume $(pwd)/dmx-docker/conf:/opt/dmx-5.0.1/conf \
    --volume $(pwd)/dmx-docker/dmx-db:/opt/dmx-5.0.1/dmx-db \
    --volume $(pwd)/dmx-docker/dmx-filedir:/opt/dmx-5.0.1/dmx-filedir \
    --volume $(pwd)/dmx-docker/bundle-deploy:/opt/dmx-5.0.1/bundle-deploy \
    --publish 8080:8080 \
    --env DMXURL=localhost \
    --name dmx \
    --detach xorxe/dmx:5.0.1-testing

Notes

Change DMXURL variable to your docker’s host url, if not running on localhost.

Differences between original download and container version:

  • logging.properties are configured to use the file handler
  • dmx.security.subnet_filter = 0.0.0.0/0 !
  • dmx.websockets.url = ws://${host_url}:8080/websocket
  • dmx.host.url = http://${host_url}:8080/
  • dmx.filerepo.path = dmx-filedir