From 217cce3cbdaf020bd77a9e6231837c3b1a01b12d Mon Sep 17 00:00:00 2001 From: Birm Date: Thu, 6 Feb 2025 13:02:54 -0500 Subject: [PATCH 1/6] docker-compose to docker compose --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 07f9cc3..9b6b3e7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,4 +6,4 @@ jobs: steps: - uses: actions/checkout@v2 - name: Build the develop stack - run: docker-compose -f develop.yml build + run: docker compose -f develop.yml build From b0f9d48ffa462565c9150ddc1887681d8c853ca6 Mon Sep 17 00:00:00 2001 From: Birm Date: Thu, 6 Feb 2025 14:07:32 -0500 Subject: [PATCH 2/6] initial partially-working ferret version --- config/postgres_db_user_setup.sql | 8 ++ osi_camicroscope.yml | 125 ++++++++++++++++++++++++++++++ 2 files changed, 133 insertions(+) create mode 100755 config/postgres_db_user_setup.sql create mode 100644 osi_camicroscope.yml diff --git a/config/postgres_db_user_setup.sql b/config/postgres_db_user_setup.sql new file mode 100755 index 0000000..64a85d2 --- /dev/null +++ b/config/postgres_db_user_setup.sql @@ -0,0 +1,8 @@ +CREATE USER ferret WITH PASSWORD 'ferretpassword'; +CREATE DATABASE ferret; +GRANT ALL PRIVILEGES ON DATABASE ferret TO ferret; + + +CREATE USER keycloak WITH PASSWORD 'password'; +CREATE DATABASE keycloak; +GRANT ALL PRIVILEGES ON DATABASE keycloak TO keycloak; \ No newline at end of file diff --git a/osi_camicroscope.yml b/osi_camicroscope.yml new file mode 100644 index 0000000..8b52529 --- /dev/null +++ b/osi_camicroscope.yml @@ -0,0 +1,125 @@ +version: '3' + +volumes: + postgres_data: + name: postgres_data + ferret_data: + name: ferret_data + +services: + postgres: + image: postgres:15 + container_name: ca-key-db + volumes: + - postgres_data:/var/lib/postgresql/data + - ./config/postgres_db_user_setup.sql:/docker-entrypoint-initdb.d/init.sql + environment: + POSTGRES_DB: keycloak + POSTGRES_USER: keycloak + POSTGRES_PASSWORD: password + restart: always + logging: + options: + max-file: "5" + max-size: "10m" + keycloak: + container_name: ca-key + image: quay.io/keycloak/keycloak:latest + command: start-dev + environment: + KC_DB: postgres + KC_DB_URL: jdbc:postgresql://ca-key-db:5432/keycloak + KC_DB_USERNAME: keycloak + KC_DB_PASSWORD: password + KEYCLOAK_ADMIN: admin + KEYCLOAK_ADMIN_PASSWORD: password + ports: + - 8080:8080 + restart: always + logging: + options: + max-file: "5" + max-size: "10m" + depends_on: + - postgres + ferretdb: + image: ghcr.io/ferretdb/ferretdb:latest + container_name: ca-ferretdb + restart: always + logging: + options: + max-file: "5" + max-size: "10m" + environment: + - FERRETDB_POSTGRESQL_URL=postgresql://ferret:ferretpassword@ca-key-db:5432/ferret + volumes: + - ferret_data:/data/db + depends_on: + - postgres + back: + build: + context: "https://github.com/camicroscope/caracal.git#v3.12.0" + args: + viewer: "v3.12.1" + depends_on: + - "ferretdb" + ports: + - "4010:4010" + container_name: ca-back + restart: always + logging: + options: + max-file: "5" + max-size: "10m" + volumes: + - ./images/:/images/ + - ./config/keycloak_login.html:/src/static/login.html + - ./jwt_keys/:/src/keys/ + - ./config/routes.json:/src/routes.json + - ./config/contentSecurityPolicy.json:/src/contentSecurityPolicy.json + environment: + DISABLE_SEC: "true" + JWK_URL: "http://ca-back:4010/keycloak/realms/camic/protocol/openid-connect/certs" + IIP_PATH: "http://ca-iip:8080/fcgi-bin/iipsrv.fcgi" + MONGO_URI: "mongodb://ca-ferretdb" + GENERATE_KEY_IF_MISSING: "true" + iip: + image: camicroscope/iipimage:version-3.11.0 + container_name: ca-iip + logging: + options: + max-file: "5" + max-size: "10m" + restart: always + volumes: + - ./images/:/images/ + loader: + build: "https://github.com/camicroscope/SlideLoader.git#v3.12.0" + container_name: ca-load + restart: always + logging: + options: + max-file: "5" + max-size: "10m" + volumes: + - ./images/:/images/ + environment: + DICOM_PORT: "11112" + DICOM_UI_PORT: "8042" + dicomsrv: + build: "https://github.com/camicroscope/dicomsrv.git#v3.12.1" + container_name: ca-dicomsrv + restart: unless-stopped + stdin_open: true + tty: true + ports: + - "8042:8042" + - "11112:11112" + volumes: + - ./jwt_keys/:/root/keys/ + - ./images/:/images/ + - ./config/OrthancConfiguration.json:/root/src/Configuration.json + environment: + DICOM_PORT: "11112" + DICOM_UI_PORT: "8042" + CARACAL_BACK_HOST_PORT: "ca-back:4010" From db022a55cec93560921c685f86d18ae0f56c64c0 Mon Sep 17 00:00:00 2001 From: Birm Date: Thu, 20 Mar 2025 14:53:47 -0400 Subject: [PATCH 3/6] whatever I had on this branch --- config/keycloak_login.html | 2 +- config/postgres_db_user_setup.sql | 7 +------ develop.yml | 3 ++- kc_caMicroscope.yml | 3 ++- osi_camicroscope.yml | 5 +++-- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/config/keycloak_login.html b/config/keycloak_login.html index ddd12f1..7728fdf 100644 --- a/config/keycloak_login.html +++ b/config/keycloak_login.html @@ -1,7 +1,7 @@ caMicroscope Keycloak Login - + diff --git a/config/postgres_db_user_setup.sql b/config/postgres_db_user_setup.sql index 64a85d2..9576524 100755 --- a/config/postgres_db_user_setup.sql +++ b/config/postgres_db_user_setup.sql @@ -1,8 +1,3 @@ CREATE USER ferret WITH PASSWORD 'ferretpassword'; CREATE DATABASE ferret; -GRANT ALL PRIVILEGES ON DATABASE ferret TO ferret; - - -CREATE USER keycloak WITH PASSWORD 'password'; -CREATE DATABASE keycloak; -GRANT ALL PRIVILEGES ON DATABASE keycloak TO keycloak; \ No newline at end of file +GRANT ALL PRIVILEGES ON DATABASE ferret TO ferret; \ No newline at end of file diff --git a/develop.yml b/develop.yml index fa95b43..0f0a4c9 100644 --- a/develop.yml +++ b/develop.yml @@ -24,6 +24,7 @@ services: - ./jwt_keys/:/src/keys/ - ./config/routes.json:/src/routes.json - ./config/contentSecurityPolicy.json:/src/contentSecurityPolicy.json + - ../camicroscope/:/src/camicroscope/ environment: JWK_URL: "https://www.googleapis.com/oauth2/v3/certs" IIP_PATH: "http://ca-iip:8080/fcgi-bin/iipsrv.fcgi" @@ -32,7 +33,7 @@ services: ALLOW_PUBLIC: "true" NUM_THREADS: 1 iip: - build: "https://github.com/camicroscope/iipImage.git#develop" + build: "https://github.com/camicroscope/iipImage.git#greyscale-bf" container_name: ca-iip restart: unless-stopped volumes: diff --git a/kc_caMicroscope.yml b/kc_caMicroscope.yml index 0be9fdd..92a1c6c 100644 --- a/kc_caMicroscope.yml +++ b/kc_caMicroscope.yml @@ -114,4 +114,5 @@ services: environment: DICOM_PORT: "11112" DICOM_UI_PORT: "8042" - CARACAL_BACK_HOST_PORT: "ca-back:4010" \ No newline at end of file + CARACAL_BACK_HOST_PORT: "ca-back:4010" + diff --git a/osi_camicroscope.yml b/osi_camicroscope.yml index 8b52529..c5d83be 100644 --- a/osi_camicroscope.yml +++ b/osi_camicroscope.yml @@ -8,7 +8,7 @@ volumes: services: postgres: - image: postgres:15 + image: ghcr.io/ferretdb/postgres-documentdb:16 container_name: ca-key-db volumes: - postgres_data:/var/lib/postgresql/data @@ -43,7 +43,7 @@ services: depends_on: - postgres ferretdb: - image: ghcr.io/ferretdb/ferretdb:latest + image: ghcr.io/ferretdb/ferretdb:2 container_name: ca-ferretdb restart: always logging: @@ -52,6 +52,7 @@ services: max-size: "10m" environment: - FERRETDB_POSTGRESQL_URL=postgresql://ferret:ferretpassword@ca-key-db:5432/ferret + - FERRETDB_AUTH=0 volumes: - ferret_data:/data/db depends_on: From 77e608530c0a64277c0e51e0f26fb0a67256cf6e Mon Sep 17 00:00:00 2001 From: Birm Date: Fri, 13 Jun 2025 13:43:05 -0400 Subject: [PATCH 4/6] working barebones ferret camicroscope --- config/postgres_db_user_setup.sql | 3 -- osi_camicroscope.yml | 56 ++++++------------------------- 2 files changed, 11 insertions(+), 48 deletions(-) delete mode 100755 config/postgres_db_user_setup.sql diff --git a/config/postgres_db_user_setup.sql b/config/postgres_db_user_setup.sql deleted file mode 100755 index 9576524..0000000 --- a/config/postgres_db_user_setup.sql +++ /dev/null @@ -1,3 +0,0 @@ -CREATE USER ferret WITH PASSWORD 'ferretpassword'; -CREATE DATABASE ferret; -GRANT ALL PRIVILEGES ON DATABASE ferret TO ferret; \ No newline at end of file diff --git a/osi_camicroscope.yml b/osi_camicroscope.yml index c5d83be..90d7ad3 100644 --- a/osi_camicroscope.yml +++ b/osi_camicroscope.yml @@ -6,44 +6,27 @@ volumes: ferret_data: name: ferret_data +networks: + default: + name: ferretdb + services: postgres: - image: ghcr.io/ferretdb/postgres-documentdb:16 + image: ghcr.io/ferretdb/postgres-documentdb:17-0.104.0-ferretdb-2.3.1 container_name: ca-key-db volumes: - postgres_data:/var/lib/postgresql/data - - ./config/postgres_db_user_setup.sql:/docker-entrypoint-initdb.d/init.sql - environment: - POSTGRES_DB: keycloak - POSTGRES_USER: keycloak - POSTGRES_PASSWORD: password - restart: always - logging: - options: - max-file: "5" - max-size: "10m" - keycloak: - container_name: ca-key - image: quay.io/keycloak/keycloak:latest - command: start-dev environment: - KC_DB: postgres - KC_DB_URL: jdbc:postgresql://ca-key-db:5432/keycloak - KC_DB_USERNAME: keycloak - KC_DB_PASSWORD: password - KEYCLOAK_ADMIN: admin - KEYCLOAK_ADMIN_PASSWORD: password - ports: - - 8080:8080 + POSTGRES_DB: postgres + POSTGRES_USER: ferret + POSTGRES_PASSWORD: ferretpassword restart: always logging: options: max-file: "5" max-size: "10m" - depends_on: - - postgres ferretdb: - image: ghcr.io/ferretdb/ferretdb:2 + image: ghcr.io/ferretdb/ferretdb:2.3.1 container_name: ca-ferretdb restart: always logging: @@ -51,7 +34,7 @@ services: max-file: "5" max-size: "10m" environment: - - FERRETDB_POSTGRESQL_URL=postgresql://ferret:ferretpassword@ca-key-db:5432/ferret + - FERRETDB_POSTGRESQL_URL=postgresql://ferret:ferretpassword@ca-key-db:5432/postgres - FERRETDB_AUTH=0 volumes: - ferret_data:/data/db @@ -74,7 +57,7 @@ services: max-size: "10m" volumes: - ./images/:/images/ - - ./config/keycloak_login.html:/src/static/login.html + - ./config/login.html:/src/static/login.html - ./jwt_keys/:/src/keys/ - ./config/routes.json:/src/routes.json - ./config/contentSecurityPolicy.json:/src/contentSecurityPolicy.json @@ -107,20 +90,3 @@ services: environment: DICOM_PORT: "11112" DICOM_UI_PORT: "8042" - dicomsrv: - build: "https://github.com/camicroscope/dicomsrv.git#v3.12.1" - container_name: ca-dicomsrv - restart: unless-stopped - stdin_open: true - tty: true - ports: - - "8042:8042" - - "11112:11112" - volumes: - - ./jwt_keys/:/root/keys/ - - ./images/:/images/ - - ./config/OrthancConfiguration.json:/root/src/Configuration.json - environment: - DICOM_PORT: "11112" - DICOM_UI_PORT: "8042" - CARACAL_BACK_HOST_PORT: "ca-back:4010" From 314a4d8a1de7a92d3ba5fb2afad30762a67e3212 Mon Sep 17 00:00:00 2001 From: Birm Date: Fri, 13 Jun 2025 13:44:07 -0400 Subject: [PATCH 5/6] revert special dev tag --- develop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/develop.yml b/develop.yml index 0f0a4c9..4238e90 100644 --- a/develop.yml +++ b/develop.yml @@ -33,7 +33,7 @@ services: ALLOW_PUBLIC: "true" NUM_THREADS: 1 iip: - build: "https://github.com/camicroscope/iipImage.git#greyscale-bf" + build: "https://github.com/camicroscope/iipImage.git#develop" container_name: ca-iip restart: unless-stopped volumes: From e1235fefb048861c2eef584af41076aaa3a20e66 Mon Sep 17 00:00:00 2001 From: Birm Date: Fri, 13 Jun 2025 13:57:52 -0400 Subject: [PATCH 6/6] key: add keycloak second --- config/postgres_db_user_setup.sql | 5 +++++ osi_camicroscope.yml | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 config/postgres_db_user_setup.sql diff --git a/config/postgres_db_user_setup.sql b/config/postgres_db_user_setup.sql new file mode 100644 index 0000000..b664ff3 --- /dev/null +++ b/config/postgres_db_user_setup.sql @@ -0,0 +1,5 @@ +CREATE USER keycloak WITH PASSWORD 'password'; +CREATE DATABASE keycloak; +GRANT ALL PRIVILEGES ON DATABASE keycloak TO keycloak; +GRANT ALL PRIVILEGES ON SCHEMA public TO keycloak; +ALTER USER keycloak WITH SUPERUSER; \ No newline at end of file diff --git a/osi_camicroscope.yml b/osi_camicroscope.yml index 90d7ad3..832badf 100644 --- a/osi_camicroscope.yml +++ b/osi_camicroscope.yml @@ -16,6 +16,7 @@ services: container_name: ca-key-db volumes: - postgres_data:/var/lib/postgresql/data + - ./config/postgres_db_user_setup.sql:/docker-entrypoint-initdb.d/init.sql environment: POSTGRES_DB: postgres POSTGRES_USER: ferret @@ -25,6 +26,26 @@ services: options: max-file: "5" max-size: "10m" + keycloak: + container_name: ca-key + image: quay.io/keycloak/keycloak:latest + command: start-dev + environment: + KC_DB: postgres + KC_DB_URL: jdbc:postgresql://ca-key-db:5432/keycloak + KC_DB_USERNAME: keycloak + KC_DB_PASSWORD: password + KEYCLOAK_ADMIN: admin + KEYCLOAK_ADMIN_PASSWORD: password + ports: + - 8080:8080 + restart: always + logging: + options: + max-file: "5" + max-size: "10m" + depends_on: + - postgres ferretdb: image: ghcr.io/ferretdb/ferretdb:2.3.1 container_name: ca-ferretdb