diff --git a/docker-compose-dev-front.yml b/docker-compose-dev-front.yml new file mode 100644 index 0000000000..9436aca5c1 --- /dev/null +++ b/docker-compose-dev-front.yml @@ -0,0 +1,37 @@ +# Shanoir NG - Import, manage and share neuroimaging data +# Copyright (C) 2009-2019 Inria - https://www.inria.fr/ +# Contact us on https://project.inria.fr/shanoir/ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see https://www.gnu.org/licenses/gpl-3.0.html + +version: '3' +services: + + nginx: + environment: + - SHANOIR_DEV=TRUE + depends_on: + - "front-dev" + + front-dev: + container_name: front-dev + build: + context: docker-compose + target: front-dev + volumes: + - "./shanoir-ng-front:/app/" + command: ng serve --host 0.0.0.0 --disable-host-check + ports: + - "4200:4200" + tty: true + networks: + - shanoir_ng_network + +networks: + shanoir_ng_network: diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml index 9436aca5c1..228837e235 100644 --- a/docker-compose-dev.yml +++ b/docker-compose-dev.yml @@ -12,26 +12,385 @@ version: '3' services: + # + # Keycloak: database and service + # + keycloak-database: + container_name: "${SHANOIR_PREFIX}keycloak-database" + build: + context: docker-compose + target: keycloak-database + environment: + - MYSQL_DATABASE=keycloak + ulimits: + nofile: + soft: 262144 + hard: 262144 + volumes: + - "keycloak-database-data:/var/lib/mysql" + networks: + - shanoir_ng_network + keycloak: + container_name: "${SHANOIR_PREFIX}keycloak" + #command: ["start-dev"] # default is "start" to run in production mode + environment: + - SHANOIR_ADMIN_EMAIL + - SHANOIR_ADMIN_NAME + - SHANOIR_URL_SCHEME + - SHANOIR_URL_HOST + - SHANOIR_VIEWER_OHIF_URL_SCHEME + - SHANOIR_VIEWER_OHIF_URL_HOST + - SHANOIR_SMTP_HOST + - SHANOIR_MIGRATION + - SHANOIR_KEYCLOAK_USER + - SHANOIR_KEYCLOAK_PASSWORD + - SHANOIR_ALLOWED_ADMIN_IPS + build: + context: docker-compose + target: keycloak + volumes: + - "keycloak-logs:/opt/keycloak/data/log" + networks: + - shanoir_ng_network + ports: + - "8080:8080" + depends_on: + - "keycloak-database" + # + # RabbitMQ: inter-microservices communication + # + rabbitmq: + container_name: "${SHANOIR_PREFIX}rabbitmq" + image: rabbitmq:3.10.7 + volumes: + - "rabbitmq-data:/var/lib/rabbitmq/mnesia/rabbitmq" + ports: + - "5672:5672" + - "15672:15672" + networks: + - shanoir_ng_network + # + # Database for all other microservices + # + database: + container_name: "${SHANOIR_PREFIX}database" + build: + context: docker-compose + target: database + command: --max_allowed_packet 20000000 + env_file: + - ./docker-compose/database/variables.env + environment: + - SHANOIR_MIGRATION + ulimits: + nofile: + soft: 262144 + hard: 262144 + volumes: + - "database-data:/var/lib/mysql" + ports: + - "3307:3306" + networks: + - shanoir_ng_network + # + # Users microservice + # + users: + container_name: "${SHANOIR_PREFIX}users" + build: + context: docker-compose + target: users + environment: + - SHANOIR_PREFIX + - SHANOIR_URL_SCHEME + - SHANOIR_URL_HOST + - SHANOIR_KEYCLOAK_USER + - SHANOIR_KEYCLOAK_PASSWORD + - SHANOIR_SMTP_HOST + - SHANOIR_ADMIN_EMAIL + - SHANOIR_CERTIFICATE + - SHANOIR_CERTIFICATE_PEM_CRT + - SHANOIR_CERTIFICATE_PEM_KEY + - SHANOIR_MIGRATION + - VIP_SERVICE_EMAIL + volumes: + - "logs:/var/log/shanoir-ng-logs" + - certificate-share-data:/etc/ssl/certs/java + networks: + - shanoir_ng_network + ports: + - "9901:9901" + - "9911:9911" + depends_on: + - "database" + - "rabbitmq" + # + # Studies microservice + # + studies: + container_name: "${SHANOIR_PREFIX}studies" + build: + context: docker-compose + target: studies + environment: + - SHANOIR_PREFIX + - SHANOIR_URL_SCHEME + - SHANOIR_URL_HOST + - SHANOIR_MIGRATION + volumes: + - "logs:/var/log/shanoir-ng-logs" + - certificate-share-data:/etc/ssl/certs/java:ro + - "studies-data:/var/studies-data" + - "tmp:/tmp" + networks: + - shanoir_ng_network + ports: + - "9902:9902" + - "9912:9912" + depends_on: + - "database" + - "rabbitmq" + - "users" + # + # Import microservice + # + import: + container_name: "${SHANOIR_PREFIX}import" + build: + context: docker-compose + target: import + environment: + - SHANOIR_PREFIX + - SHANOIR_URL_SCHEME + - SHANOIR_URL_HOST + - SHANOIR_MIGRATION + volumes: + - "logs:/var/log/shanoir-ng-logs" + - certificate-share-data:/etc/ssl/certs/java:ro + - "tmp:/tmp" + networks: + - shanoir_ng_network + ports: + - "9903:9903" + - "9913:9913" + # uncomment below for local testing of import-from-pacs, enable: + # pacs-to-ms-import: c-move from dcm4chee arc light to ms import + # do not add by default, as it blocks local ShUp from using 44105 + # - "44105:44105" + depends_on: + - "database" + - "rabbitmq" + - "users" + # + # Datasets microservice + # + datasets: + container_name: "${SHANOIR_PREFIX}datasets" + build: + context: docker-compose + target: datasets + environment: + - SHANOIR_PREFIX + - SHANOIR_URL_SCHEME + - SHANOIR_URL_HOST + - SHANOIR_VIEWER_OHIF_URL_SCHEME + - SHANOIR_VIEWER_OHIF_URL_HOST + - SHANOIR_MIGRATION + - VIP_URL_SCHEME + - VIP_URL_HOST + - VIP_CLIENT_SECRET + volumes: + - "logs:/var/log/shanoir-ng-logs" + - certificate-share-data:/etc/ssl/certs/java:ro + - "tmp:/tmp" + - "datasets-data:/var/datasets-data" + networks: + - shanoir_ng_network + ports: + - "9904:9904" + - "9914:9914" + depends_on: + - "database" + - "rabbitmq" + - "users" - nginx: - environment: - - SHANOIR_DEV=TRUE + preclinical: + container_name: "${SHANOIR_PREFIX}preclinical" + build: + context: docker-compose + target: preclinical + environment: + - SHANOIR_PREFIX + - SHANOIR_URL_SCHEME + - SHANOIR_URL_HOST + - SHANOIR_MIGRATION + volumes: + - "logs:/var/log/shanoir-ng-logs" + - certificate-share-data:/etc/ssl/certs/java:ro + - "tmp:/tmp" + - "extra-data:/var/extra-data" + networks: + - shanoir_ng_network + ports: + - "9905:9905" + - "9915:9915" + depends_on: + - "database" + - "rabbitmq" + - "users" + # + # Nifti conversion microservice + # + nifti-conversion: + container_name: "${SHANOIR_PREFIX}nifti-conversion" + build: + context: docker-compose + target: nifti-conversion + environment: + - SHANOIR_PREFIX + - SHANOIR_URL_SCHEME + - SHANOIR_URL_HOST + - SHANOIR_MIGRATION + volumes: + - "logs:/var/log/shanoir-ng-logs" + - "datasets-data:/var/datasets-data" + - "tmp:/tmp" + networks: + - shanoir_ng_network depends_on: - - "front-dev" + - "import" + - "datasets" - front-dev: - container_name: front-dev + # + # Solr microservice for Shanoir-NG search + # + solr: + container_name: "${SHANOIR_PREFIX}solr" build: context: docker-compose - target: front-dev + target: solr + environment: + - SOLR_LOG_LEVEL=SEVERE + volumes: + - "solr-data:/var/solr" + networks: + - shanoir_ng_network + ports: + - "8983:8983" + # Backup PACS microservice: dcm4chee 5 arc-light + # + # The config for the dcm4chee containers is derived from this template: + # https://github.com/dcm4che-dockerfiles/dcm4chee-arc-psql/blob/master/docker-compose.yml + ldap: + container_name: "${SHANOIR_PREFIX}ldap" + image: dcm4che/slapd-dcm4chee:2.6.2-27.0 + logging: + driver: json-file + options: + max-size: "10m" + networks: + - shanoir_ng_network + ports: + - "389:389" + env_file: ./docker-compose/dcm4chee/variables.env volumes: - - "./shanoir-ng-front:/app/" - command: ng serve --host 0.0.0.0 --disable-host-check + - "dcm4chee-ldap-data:/var/lib/openldap/openldap-data" + - "dcm4chee-sldap-data:/etc/openldap/slapd.d" + dcm4chee-database: + container_name: "${SHANOIR_PREFIX}dcm4chee-database" + image: dcm4che/postgres-dcm4chee:14.4-27 + logging: + driver: json-file + options: + max-size: "10m" + networks: + - shanoir_ng_network ports: - - "4200:4200" - tty: true + - "5432:5432" + env_file: ./docker-compose/dcm4chee/variables.env + volumes: + - "dcm4chee-database-data:/var/lib/postgresql/data" + dcm4chee-arc: + container_name: "${SHANOIR_PREFIX}dcm4chee-arc" + image: dcm4che/dcm4chee-arc-psql:5.27.0 + logging: + driver: json-file + options: + max-size: "10m" networks: - shanoir_ng_network + ports: + - "8081:8081" + - "8443:8443" + - "9990:9990" + - "11112:11112" + - "2575:2575" + env_file: ./docker-compose/dcm4chee/variables.env + environment: + POSTGRES_HOST: "${SHANOIR_PREFIX}dcm4chee-database" + WILDFLY_CHOWN: /storage + WILDFLY_WAIT_FOR: "${SHANOIR_PREFIX}ldap:389 ${SHANOIR_PREFIX}dcm4chee-database:5432" + depends_on: + - "ldap" + - "dcm4chee-database" + volumes: + - "dcm4chee-arc-wildfly-data:/opt/wildfly/standalone" + - "dcm4chee-arc-storage-data:/storage" + # + # Nginx + # + nginx: + container_name: shanoir-ng-nginx + build: + context: docker-compose + target: nginx + environment: + - SHANOIR_PREFIX + - SHANOIR_URL_SCHEME + - SHANOIR_URL_HOST + - SHANOIR_VIEWER_OHIF_URL_SCHEME + - SHANOIR_VIEWER_OHIF_URL_HOST + - SHANOIR_X_FORWARDED + - SHANOIR_INSTANCE_NAME + - SHANOIR_INSTANCE_COLOR + - SHANOIR_CERTIFICATE_PEM_CRT + - SHANOIR_CERTIFICATE_PEM_KEY + - SHANOIR_KEYCLOAK_ADAPTER_MODE + - VIP_URL_SCHEME + - VIP_URL_HOST + volumes: + - "logs:/var/log/nginx" + - certificate-share-data:/opt/ssl:ro + networks: + - shanoir_ng_network + ports: + - "443:443" + depends_on: + - "users" + - "studies" + - "import" + - "datasets" + - "preclinical" + - "rabbitmq" + - "nifti-conversion" + +volumes: + keycloak-database-data: + rabbitmq-data: + database-data: + datasets-data: + extra-data: + studies-data: + dcm4chee-ldap-data: + dcm4chee-sldap-data: + dcm4chee-database-data: + dcm4chee-arc-wildfly-data: + dcm4chee-arc-storage-data: + solr-data: + certificate-share-data: + tmp: + logs: + keycloak-logs: networks: shanoir_ng_network: diff --git a/docker-compose.yml b/docker-compose.yml index 228837e235..1ada8aafd0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,9 +17,7 @@ services: # keycloak-database: container_name: "${SHANOIR_PREFIX}keycloak-database" - build: - context: docker-compose - target: keycloak-database + image: "ghcr.io/fli-iam/shanoir-ng/keycloak-database:ng_v2.3.1" environment: - MYSQL_DATABASE=keycloak ulimits: @@ -45,9 +43,7 @@ services: - SHANOIR_KEYCLOAK_USER - SHANOIR_KEYCLOAK_PASSWORD - SHANOIR_ALLOWED_ADMIN_IPS - build: - context: docker-compose - target: keycloak + image: "ghcr.io/fli-iam/shanoir-ng/keycloak:ng_v2.3.1" volumes: - "keycloak-logs:/opt/keycloak/data/log" networks: @@ -74,9 +70,7 @@ services: # database: container_name: "${SHANOIR_PREFIX}database" - build: - context: docker-compose - target: database + image: "ghcr.io/fli-iam/shanoir-ng/database:ng_v2.4.1" command: --max_allowed_packet 20000000 env_file: - ./docker-compose/database/variables.env @@ -97,9 +91,7 @@ services: # users: container_name: "${SHANOIR_PREFIX}users" - build: - context: docker-compose - target: users + image: "ghcr.io/fli-iam/shanoir-ng/users:ng_v2.4.1" environment: - SHANOIR_PREFIX - SHANOIR_URL_SCHEME @@ -129,9 +121,7 @@ services: # studies: container_name: "${SHANOIR_PREFIX}studies" - build: - context: docker-compose - target: studies + image: "ghcr.io/fli-iam/shanoir-ng/studies:ng_v2.4.1" environment: - SHANOIR_PREFIX - SHANOIR_URL_SCHEME @@ -156,9 +146,7 @@ services: # import: container_name: "${SHANOIR_PREFIX}import" - build: - context: docker-compose - target: import + image: "ghcr.io/fli-iam/shanoir-ng/import:ng_v2.4.1" environment: - SHANOIR_PREFIX - SHANOIR_URL_SCHEME @@ -186,9 +174,7 @@ services: # datasets: container_name: "${SHANOIR_PREFIX}datasets" - build: - context: docker-compose - target: datasets + image: "ghcr.io/fli-iam/shanoir-ng/datasets:ng_v2.4.1" environment: - SHANOIR_PREFIX - SHANOIR_URL_SCHEME @@ -216,9 +202,7 @@ services: preclinical: container_name: "${SHANOIR_PREFIX}preclinical" - build: - context: docker-compose - target: preclinical + image: "ghcr.io/fli-iam/shanoir-ng/preclinical:ng_v2.4.1" environment: - SHANOIR_PREFIX - SHANOIR_URL_SCHEME @@ -243,9 +227,7 @@ services: # nifti-conversion: container_name: "${SHANOIR_PREFIX}nifti-conversion" - build: - context: docker-compose - target: nifti-conversion + image: "ghcr.io/fli-iam/shanoir-ng/nifti-conversion:ng_v2.4.1" environment: - SHANOIR_PREFIX - SHANOIR_URL_SCHEME @@ -266,9 +248,7 @@ services: # solr: container_name: "${SHANOIR_PREFIX}solr" - build: - context: docker-compose - target: solr + image: "ghcr.io/fli-iam/shanoir-ng/solr:ng_v2.4.1" environment: - SOLR_LOG_LEVEL=SEVERE volumes: @@ -341,9 +321,7 @@ services: # nginx: container_name: shanoir-ng-nginx - build: - context: docker-compose - target: nginx + image: "ghcr.io/fli-iam/shanoir-ng/nginx:ng_v2.4.1" environment: - SHANOIR_PREFIX - SHANOIR_URL_SCHEME