Running XNAT in a Dockerized Container with Configurable Dependencies
The XNAT team has been distributing containerized versions of XNAT since the release of XNAT 1.7.6, via the xnat-docker-compose repo. However, motivated by the complex build process and set of related dependencies required to run the Beta version of the XNAT ML demo, we created the "dependency management" branch in the xnat-docker-compose repo. The file README.md in this branch contains detailed instructions on setup, as well as a listing of recipes or manifests that can be used to bring up a specific XNAT build. Here is a brief subset of those instructions.
Installing
Start by cloning the xnat-docker-compose repository and checking out the features/dependency-mgmt
branch:
$ git clone https://github.com/NrgXnat/xnat-docker-compose
$ cd xnat-docker-compose
$ git checkout features/dependency-mgmt
Launching
At this point, you can start XNAT with a basic configuration just by building and launching the docker-compose
configuration:
$ ./gradlew composeBuild composeUp
The composeBuild
task builds containers for any services that require special container builds, while composeUp
actually launches the containers. You can monitor the status of the deployment by watching the log generated for the xnat-web container:
$ docker logs --follow xnat-web
You should eventually see a message like this:
Mar 02, 2021 10:35:24 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 208163 ms
At that point, open http://localhost in a browser and you should see the XNAT login page.
This basic configuration consists of containers running:
- XNAT itself, running as an application in Tomcat 9.0
- Traefik, a front-end proxy and load balancer that directs HTTP requests to the appropriate service
- PostgreSQL, for database services
You can also launch XNAT in a full-stack deployment, which includes containers running:
- Orthanc, a PACS service
- ActiveMQ, a messaging broker for distributing processing tasks
- Postfix relay service, for relaying emails to another SMTP server
To launch the full-stack deployment, start the configuration with the following command:
$ ./gradlew fullStackComposeBuild fullStackComposeUp
Just like with composeBuild
and composeUp
, the fullStackComposeBuild
task builds containers for any services that require special container builds, while fullStackComposeUp
launches the containers. You can monitor the status of the deployment by watching the log generated for the xnat-web container.
Next Steps
The documentation in the GitHub repo contains detailed instructions on configuring your containerized XNAT, as well as mounting data, modifications necessary to use the Container Service, and other troubleshooting.