From 479f351aeab96ed3e3f79bd8c48fe5882f1f2a79 Mon Sep 17 00:00:00 2001 From: "DESKTOP-93NNRN8\\zhaow" Date: Wed, 23 Oct 2024 15:24:41 +0200 Subject: [PATCH] Add: new orthanc yml file and orthanc dockerfile --- docker-compose-orthanc.yml | 57 ++++++++++++++++++++++++++++++++++++++ orthanc_dockerfile | 36 ++++++++++++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 docker-compose-orthanc.yml create mode 100644 orthanc_dockerfile diff --git a/docker-compose-orthanc.yml b/docker-compose-orthanc.yml new file mode 100644 index 0000000..06330fc --- /dev/null +++ b/docker-compose-orthanc.yml @@ -0,0 +1,57 @@ +version: "3.8" + +services: + orthanc: + command: /run/secrets/ + secrets: + - orthanc.json + build: + context: . + dockerfile: orthanc_dockerfile + restart: always + environment: + - ORTHANC_NAME=${ORTHANC_NAME} + - ORTHANC_AUTHENTICATION=keycloak + - KEYCLOAK_REALM=orthanc + - KEYCLOAK_CLIENT_ID=orthanc + volumes: + - orthanc-db:/var/lib/orthanc/db + networks: + - ozone + - web + # ports: + # - "8888:8042" + depends_on: + env-substitution: + condition: service_completed_successfully + + # keycloak: + # image: orthancteam/orthanc-keycloak:latest + # restart: always + # ports: + # - "8080:8080" + # environment: + # - ORTHANC__USER__NAME=orthanc + # - ORTHANC__USER__PASSWORD=orthanc + # - KC_DB="postgresql" + # - KC_DB_URL="jdbc:postgresql://postgres:5432/keycloak" + # - KC_DB_USERNAME="orthanc" + # - KC_DB_PASSWORD="orthanc" + # networks: + # - ozone + # - web + + env-substitution: + environment: + - ORTHANC_PUBLIC_URL=http://${ORTHANC_HOSTNAME} + +secrets: + orthanc.json: + file: ../../distro/configs/orthanc/config/orthanc.json + +networks: + ozone: + web: + +volumes: + orthanc-db: \ No newline at end of file diff --git a/orthanc_dockerfile b/orthanc_dockerfile new file mode 100644 index 0000000..ca733ef --- /dev/null +++ b/orthanc_dockerfile @@ -0,0 +1,36 @@ +# Use the base Orthanc plugins image +FROM jodogne/orthanc-plugins:latest + +RUN apt-get update && apt-get install -y openjdk-17-jdk cmake build-essential python3 unzip libjsoncpp-dev \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 + +WORKDIR /home/root/ +RUN wget -qO- https://orthanc.uclouvain.be/downloads/sources/orthanc-java/OrthancJava-1.0.tar.gz | tar xvz + +WORKDIR /home/root/OrthancJava-1.0 +RUN mkdir BuildPlugin && \ + cd BuildPlugin && \ + cmake ../Plugin -DCMAKE_BUILD_TYPE=Release && \ + make + +WORKDIR /home/root/OrthancJava-1.0 +RUN mkdir BuildJavaSDK && \ + cd BuildJavaSDK && \ + cmake ../JavaSDK && \ + make + +WORKDIR /home/root/ +RUN wget https://orthanc.uclouvain.be/downloads/cross-platform/orthanc-java/mainline/OrthancFHIR.jar + +COPY java/HelloWorld.java /home/root/java/ +WORKDIR /home/root/java/ +RUN javac -cp /home/root/OrthancJava-1.0/BuildJavaSDK/OrthancJavaSDK.jar HelloWorld.java + +# Expose Orthanc default port +EXPOSE 4242 8042 + +ENV LD_PRELOAD=/usr/lib/jvm/java-17-openjdk-amd64/lib/server/libjvm.so +ENTRYPOINT ["/usr/local/sbin/Orthanc"] \ No newline at end of file