Docker deploy example
- Go to root directory and use the gradle wrapper to create war file for the web app like this. The WAR file is created in ‘root/build/libs/‘
$ ./gradlew clean war
- Update the radar.yml in root for correct configurtation.
- Then build the docker image naming it redcap using the Dockerfile located in root directory
$ docker build -t redcapintegration .
- Then run the app in a container using using the image created above mapping port 8080 (host) to 8080 (container)
$ docker run --name redcapintegration -v "./radar.yml:/usr/local/tomcat/conf/radar/" -it --rm -d -p 8080:8080 redcapintegration
- Access the entry point like this
$ curl -X POST “<Host IP or URL>:<Port>/redcap/trigger”
- Or if accessing on the same machine as the container do
$ curl -X POST “http://localhost:8080/redcap/trigger
- Please note that the radar.yml config file should be valid or else the deploy will fail.
If running this along with other components on docker usinf docker-compose, you can add the following to your docker-compose.yml file under the
test: ["CMD", "curl", "-IX", "POST", "http://localhost:8080/redcap/trigger"]
Please check the RADAR-base platform docker-compose.yml file for more information.
NOTE: If you don't want to build docker image from source and want to use a release version of the app for docker you can also pull one of the images from docker hub registry - radarbase/radar-redcapintegration