REDcap-integration Docker deploy

Docker deploy example

  1. 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
  2. Update the radar.yml in root for correct configurtation.
  3. Then build the docker image naming it redcap using the Dockerfile located in root directory $ docker build -t redcapintegration .
  4. 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
  5. Access the entry point like this $ curl -X POST “<Host IP or URL>:<Port>/redcap/trigger”
  6. Or if accessing on the same machine as the container do $ curl -X POST “http://localhost:8080/redcap/trigger
  7. Please note that the radar.yml config file should be valid or else the deploy will fail.

Docker-compose example

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 services -

  redcap-integration:
    build: .
    image: redcapintegration
    networks:
      - default
    restart: always
    volumes:
      - "./radar.yml:/usr/local/tomcat/conf/radar/"
    healthcheck:
      test: ["CMD", "curl", "-IX", "POST", "http://localhost:8080/redcap/trigger"]
      interval: 1m
      timeout: 5s
      retries: 3

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