orthanc-server / orthanc-setup-samples

Sample Orthanc deployments and scripts
Other
61 stars 14 forks source link

Connect orthanc explorer 2 with custom ui and integrate to keycloak to dcm4chee for sending DICOM #4

Closed Darfito closed 7 months ago

Darfito commented 7 months ago

i want to connect orthanc that already have orthanc explorer 2 custom ui and integrate to keycloak to dcm4chee for sending DICOM. on below this is my docker-compose that i already modified from this github link : https://github.com/orthanc-team/orthanc-auth-service/blob/main/minimal-setup/keycloak/README.md

# SPDX-FileCopyrightText: 2022 - 2024 Orthanc Team SRL <info@orthanc.team>
#
# SPDX-License-Identifier: CC0-1.0

version: "3"
services:

  nginx:
    image: orthancteam/orthanc-nginx:24.2.0
    depends_on: [orthanc, orthanc-auth-service, keycloak]
    restart: unless-stopped
    ports: ["80:80"]
# if setting ENABLE_HTTPS: "true" env var, uncomment the following 4 lines and comment the line with 'ports: ["80:80"]'
#    ports: ["443:443"]
#    volumes:
#      - /.../crt.pem:/etc/nginx/tls/crt.pem
#      - /.../key.pem:/etc/nginx/tls/key.pem
    environment:
      ENABLE_ORTHANC: "true"
      ENABLE_KEYCLOAK: "true"
      ENABLE_ORTHANC_TOKEN_SERVICE: "false"
      ENABLE_HTTPS: "false"
# to use OHIF-plugin: you don't need the OHIF reverse proxy
      ENABLE_OHIF: "true"

  orthanc:
# to use OHIF-plugin:  use the master-unstable image
    image: orthancteam/orthanc-pre-release:master-unstable
    # image: orthancteam/orthanc:24.3.3
    volumes:
      - orthanc-storage:/var/lib/orthanc/db
      - ./custom.css:/custom.css
      - ./logo.png:/logo.png
    depends_on: [orthanc-db]
    restart: unless-stopped
    environment:
      STONE_WEB_VIEWER_PLUGIN_ENABLED: "true"
      DICOM_WEB_PLUGIN_ENABLED: "true"
      ORTHANC__ORTHANC_EXPLORER_2__UI_OPTIONS__ENABLE_DICOM_MODALITIES: "true"
      # to use OHIF-plugin:  make sure to have a "OHIF" config and use "dicom-web" source
#      OHIF_PLUGIN_ENABLED: "true"
      ORTHANC__POSTGRESQL__HOST: "orthanc-db"
      VERBOSE_ENABLED: "true"
      VERBOSE_STARTUP: "true"
      ORTHANC__DICOM_MODALITIES: |
        {
            "dcm4chee": [ "DCM4CHEE", "arc", 11112 ]
        }
      ORTHANC_JSON: |
        {
          "Name": "Orthanc",
          "OrthancExplorer2": {
            "IsDefaultOrthancUI": true,
            "Theme": "light",
            "CustomLogoPath": "/logo.png",
            "CustomCssPath": "/custom.css",
            "UiOptions": {
              "EnableShares": true,
              "DefaultShareDuration": 0,
              "ShareDurations": [0, 7, 15, 30, 90, 365],
              "EnableOpenInOhifViewer3": true,
              // to use OHIF-plugin:  use http://localhost/orthanc/ohif/
              //"OhifViewer3PublicRoot": "http://localhost/orthanc/ohif/"
              "OhifViewer3PublicRoot": "http://localhost/ohif/"
            },
            "Tokens" : {
              "InstantLinksValidity": 3600,
              "ShareType": "ohif-viewer-publication"
            },
            "Keycloak" : {
              "Enable": true,
              "Url": "http://localhost/keycloak/",
              "Realm": "orthanc",
              "ClientId": "orthanc"
            }
          },
          "AuthenticationEnabled": false,     // because it is handled by the authorization plugin
          "Authorization": {
            "WebServiceRootUrl": "http://orthanc-auth-service:8000/",
            "WebServiceUsername": "share-user",
            "WebServicePassword": "change-me",
            // to use OHIF-plugin:  make sure to include "ohif" in the list
            "StandardConfigurations" : [
              "osimis-web-viewer",
              "stone-webviewer",
              "orthanc-explorer-2",
              "ohif"
            ],
            "TokenHttpHeaders" : [ "api-key" ],
            "CheckedLevel": "studies"
          },
          "DicomWeb": {
            "Enable": true,
            "PublicRoot": "/orthanc/dicom-web/"
          }

          // to use OHIF-plugin:  make sure to have a "OHIF" config and use "dicom-web" source
          //, "OHIF": {
          //  "DataSource": "dicom-web",
          //  "RouterBasename": "/orthanc/ohif/"
          //}
        }

  orthanc-auth-service:
    image: orthancteam/orthanc-auth-service:24.2.0
    # always disable port mapping in production !!!
    # ports: ["8000:8000"]
    # permissions can be customized in the permissions.json file
    volumes:
      - ./permissions.jsonc:/orthanc_auth_service/permissions.json
    depends_on: [keycloak]
    restart: unless-stopped
    environment:
      SECRET_KEY: "change-me-I-am-a-secret-key"
      ENABLE_KEYCLOAK: "true"
      ENABLE_KEYCLOAK_API_KEYS: "true"
      KEYCLOAK_CLIENT_SECRET: "qTqdbYTPoXbzByGnSInF6CXmEkwKNIqc"
      PUBLIC_ORTHANC_ROOT: "http://localhost/orthanc/"
      PUBLIC_LANDING_ROOT: "http://localhost/orthanc/ui/app/token-landing.html"
      # to use OHIF-plugin:  make sure to use http://localhost/orthanc/ohif/
#      PUBLIC_OHIF_ROOT: "http://localhost/ohif/"
      PUBLIC_OHIF_ROOT: "http://localhost/orthanc/ohif/"
      USERS: |
        {
          "share-user": "change-me"
        }

  orthanc-db:
    image: postgres:14
    restart: unless-stopped
    volumes: ["orthanc-db:/var/lib/postgresql/data"]
    environment:
      POSTGRES_HOST_AUTH_METHOD: "trust"

# to use OHIF-plugin: you don't need this container
  ohif:
    image: orthancteam/ohif-v3:24.2.0
#  uncomment if you want to customize ohif configuration
#    volumes:
#      - ./ohif-app-config.js:/usr/share/nginx/html/app-config.js
    restart: unless-stopped

  keycloak:
    image: orthancteam/orthanc-keycloak:24.2.0
    depends_on: [keycloak-db]
    restart: unless-stopped
#    healthcheck:
#      test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
    environment:
      KEYCLOAK_ADMIN: "admin"
      KEYCLOAK_ADMIN_PASSWORD: "change-me"
      KC_DB: "postgres"
      KC_DB_URL: "jdbc:postgresql://keycloak-db:5432/keycloak"
      KC_DB_USERNAME: "keycloak"
      KC_DB_PASSWORD: "keycloak"
      KC_HOSTNAME_URL: "http://localhost/keycloak/"
      KC_HOSTNAME_ADMIN_URL: "http://localhost/keycloak/"
      # KC_HOSTNAME_URL: "https://mydomain.com/keycloak"
      # KC_HOSTNAME_ADMIN_URL: "https://mydomain.com/keycloak"

  keycloak-db:
    image: postgres:14
    restart: unless-stopped
    volumes: ["keycloak-db:/var/lib/postgresql/data"]
    environment:
      POSTGRES_PASSWORD: "keycloak"
      POSTGRES_USER: "keycloak"
      POSTGRES_DB: "keycloak"

  pacs:
    image: orthancteam/orthanc
    volumes: ["pacs-storage:/var/lib/orthanc/db"]
    depends_on: [pacs-db]
    restart: unless-stopped
    environment:
      ORTHANC__NAME: "Pacs"
      ORTHANC__DICOM_AET: "PACS"
      ORTHANC__ORTHANC_EXPLORER_2__IS_DEFAULT_ORTHANC_UI: "true"
      ORTHANC__AUTHENTICATION_ENABLED: "false"
      ORTHANC__POSTGRESQL__HOST: "pacs-db"
      OSIMIS_WEB_VIEWER1_PLUGIN_ENABLED: "true"
      ORTHANC__DICOM_MODALITIES: |
        {
         "orthanc": ["ORTHANC", "orthanc-for-admin", 4242],
         "dcm4chee" : [ "DCM4CHEE", "arc", 11112 ]
        }

  pacs-db:
    image: postgres:14
    restart: unless-stopped
    volumes: ["pacs-db:/var/lib/postgresql/data"]
    environment:
      POSTGRES_HOST_AUTH_METHOD: "trust"

volumes:
  orthanc-storage:
  orthanc-db:
  keycloak-db:
  pacs-storage:
  pacs-db:

image

amazy commented 7 months ago

already addressed here