From 12f6c332d7a72c4f5ddc8d2faace8a1837e93312 Mon Sep 17 00:00:00 2001 From: "Arnaud G. GIBERT" Date: Thu, 25 Jun 2026 20:30:11 +0200 Subject: [PATCH] - Initial release, - Based on rx3-docker/php-apache:1.7.0-mga9 & rx3-docker/mariadb:1.2.0-mga9 images, - Use medshake 8.4.2 from Rx3 RPM, - Use docker-tools-1.5.2. --- .gitignore | 2 + Dockerfile | 94 +++++++++++++++++++ ReadMe.txt | 19 ++++ ReleaseNotes.txt | 8 ++ compose.yaml | 111 +++++++++++++++++++++++ env.dist | 119 +++++++++++++++++++++++++ var/lib/mysql/.gitignore | 4 + var/log/httpd-webapp/.gitignore | 4 + var/log/init-database/.gitignore | 4 + var/log/init-webapp/.gitignore | 4 + var/log/supervisor-database/.gitignore | 4 + var/log/supervisor-webapp/.gitignore | 4 + 12 files changed, 377 insertions(+) create mode 100644 .gitignore create mode 100644 Dockerfile create mode 100644 ReadMe.txt create mode 100644 ReleaseNotes.txt create mode 100644 compose.yaml create mode 100644 env.dist create mode 100644 var/lib/mysql/.gitignore create mode 100644 var/log/httpd-webapp/.gitignore create mode 100644 var/log/init-database/.gitignore create mode 100644 var/log/init-webapp/.gitignore create mode 100644 var/log/supervisor-database/.gitignore create mode 100644 var/log/supervisor-webapp/.gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..556bc65 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*~ +*.old diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..006aa67 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,94 @@ +# Rx3-Docker/MedShake Dockerfile +#------------------------------------------------------------------------------- + +ARG IMG_FROM_URL="rx3-docker/php-apache:latest" + +FROM ${IMG_FROM_URL} + +ARG IMG_NAME +ARG IMG_NAME_FULL +ARG IMG_VERSION +ARG IMG_MAINTAINER +ARG IMG_URL + +LABEL org.rx3.${IMG_NAME}.name=${IMG_NAME_FULL} +LABEL org.rx3.${IMG_NAME}.version=${IMG_VERSION} +LABEL org.rx3.${IMG_NAME}.maintainer=${IMG_MAINTAINER} +LABEL maintainer=${IMG_MAINTAINER} + +ARG HTTPD_VHOST_CONFIG_DIR=/etc/httpd/conf/sites.d/default_vhost.d +ARG MEDSHAKE_CORE_CONFIG_FILE=${HTTPD_VHOST_CONFIG_DIR}/70-medshake-core.conf +#ARG MEDSHAKE_SHARE_DIR=/usr/share/medshake +ARG MEDSHAKE_SHARE_DIR=/var/www/medshake +ARG MEDSHAKE_WWW_DIR=/var/www/medshake + + + +#--------------------------------------------------------------------------------------------------- +ARG MEDSHAKE='#!/bin/bash \n\ + \n\ +if [[ ! -d '${MEDSHAKE_WWW_DIR}'/public_html ]] \n\ +then \n\ + cp -Rf '${MEDSHAKE_WWW_DIR}.ref/*' '${MEDSHAKE_WWW_DIR}' \n\ +fi \n\ + \n\ +chown -R apache:apache '${MEDSHAKE_WWW_DIR}' \n\ +chmod -R a-x,a+X '${MEDSHAKE_WWW_DIR}' \n\ +chmod o-rwx '${MEDSHAKE_WWW_DIR}' \n\ +chmod -R ug+rwX '${MEDSHAKE_WWW_DIR}' \n\ + \n\ +cp -f '${MEDSHAKE_CORE_CONFIG_FILE}.ref' '${MEDSHAKE_CORE_CONFIG_FILE}' \n\ + \n\ +sed -i -e "s%MEDSHAKE_URL%${MEDSHAKE_URL}%g" '${MEDSHAKE_CORE_CONFIG_FILE}' \n\ + \n\ +IFS=":" \n\ +read -r -a file <<< "${MEDSHAKE_ROOT_LINK_LISTZZZ}" \n\ + \n\ +i=0 \n\ +while [[ ${i} -lt ${#file[@]} ]] \n\ +do \n\ + ln -s '${MEDSHAKE_WWW_DIR}'/${file[${i}]} '${MEDSHAKE_SHARE_DIR}' \n\ + \n\ + i=$(( ${i} + 1)) \n\ +done \n\ + \n\ +sed -i -e "s%mailhub=mail%mailhub=${SMTP_SERVER}%" /etc/ssmtp/ssmtp.conf' +#--------------------------------------------------------------------------------------------------- + + + +#--------------------------------------------------------------------------------------------------- +ARG MEDSHAKE_CORE_CONFIG='# MedShake configuration \n\ + \n\ +Alias MEDSHAKE_URL '${MEDSHAKE_SHARE_DIR}'/public_html/ \n\ + \n\ + \n\ + AllowOverride all \n\ + Require all granted \n\ + Options +FollowSymLinks \n\ + \n\ + \n\ +SetEnv MEDSHAKEEHRPATH '${MEDSHAKE_SHARE_DIR} +#--------------------------------------------------------------------------------------------------- + + + +RUN . /etc/profile.d/rx3.sh && isl --add ${IMG_URL} \ + && urpmi.update -a \ + && urpmi --force wget ssmtp ghostscript pdftk-java php-posix php-bcmath php-curl php-gd php-gnupg php-soap php-yaml php-zip php-phar php-dom php-iconv php-fileinfo php-xmlreader composer git lib64opencl1 \ + && mkdir /tmp/medshake \ + && wget -q -O - https://github.com/MedShake/MedShakeEHR-base/archive/refs/tags/v8.4.2.tar.gz | tar xzvf - -C /tmp/medshake \ + && mv /tmp/medshake/* ${MEDSHAKE_WWW_DIR}.ref \ + && COMPOSER_ALLOW_SUPERUSER=1 composer install --working-dir ${MEDSHAKE_WWW_DIR}.ref --no-interaction --no-cache -o \ + && COMPOSER_ALLOW_SUPERUSER=1 composer install --working-dir ${MEDSHAKE_WWW_DIR}.ref/public_html --no-interaction --no-cache -o \ + && rmdir /tmp/medshake \ + && echo -e "${MEDSHAKE}" | sed -e "s/\`/'/g" -e 's/ *$//' >/etc/init.d/medshake \ + && chmod a+x /etc/init.d/medshake \ + && ln -s /etc/init.d/medshake /etc/rcD.d/S40medshake \ + && echo -e "${MEDSHAKE_CORE_CONFIG}" | sed -e "s/\`/'/g" -e 's/ *$//' >${MEDSHAKE_CORE_CONFIG_FILE}.ref + +# && mv /etc/httpd/conf/sites.d/medshake.conf ${MEDSHAKE_CORE_CONFIG_FILE}.ref \ +# && sed -i -e "s%Alias /medshake/%Alias MEDSHAKE_URL%" ${MEDSHAKE_CORE_CONFIG_FILE}.ref \ + +# && wget -q -O - https://getcomposer.org/download/2.2.28/composer.phar >/usr/local/bin/composer \ +# && chmod a+x /usr/local/bin/composer \ diff --git a/ReadMe.txt b/ReadMe.txt new file mode 100644 index 0000000..8f150c1 --- /dev/null +++ b/ReadMe.txt @@ -0,0 +1,19 @@ +Welcome to Rx3-Docker/MedShake docker image! + + + +This project aims to build a MedShake EHR docker image. + +Features: + - Curtently based on rx3-docker/php-apache:1.7.0-mga9 & rx3-docker/mariadb:1.2.0-mga9 images, + - Sync with Orthanc Rx3 RPM 8.4.2. + + + +Enjoy it! + +Your Rx3 Team. + +-- +arnaud@rx3.net +https://git.rx3.org/gitea/rx3-docker/orthanc diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt new file mode 100644 index 0000000..91301ec --- /dev/null +++ b/ReleaseNotes.txt @@ -0,0 +1,8 @@ +------------------------------------------------------------------------------------------------------------------------------------ +Rx3-Docker/MedShake V 1.0.0 - A. GIBERT - 2026/06/25 +------------------------------------------------------------------------------------------------------------------------------------ + +- Initial release, +- Based on rx3-docker/php-apache:1.7.0-mga9 & rx3-docker/mariadb:1.2.0-mga9 images, +- Use medshake 8.4.2 from Rx3 RPM, +- Use docker-tools-1.5.2. diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..b5d14f1 --- /dev/null +++ b/compose.yaml @@ -0,0 +1,111 @@ +# Rx3-Docker/MedShake Docker Image +#------------------------------------------------------------------------------- + +name: ${HOST_NAME_PREFIX} + +services: + database: + container_name: ${DB_HOST_NAME} + hostname: ${DB_HOST_NAME} + + image: ${DB_IMG_URL} + + restart: unless-stopped + + environment: + MARIADB_UID: ${DB_USER_ID} + MARIADB_GID: ${DB_GROUP_ID} + MARIADB_ROOT_HOST: ${DB_ROOT_HOST} + MARIADB_ROOT_PASSWORD: ${DB_ROOT_PASSWORD} + MARIADB_DATABASE: ${DB_DB_NAME} + MARIADB_USER: ${DB_DB_USER} + MARIADB_PASSWORD: ${DB_DB_PASSWORD} + + healthcheck: + test: ["CMD", 'mysqladmin', 'ping', '-h', 'localhost', '-u', 'root', '-p${DB_ROOT_PASSWORD}' ] + interval: 10s + timeout: 3s + retries: 3 + + volumes: + - ./${DB_LIB_EXT}:${DB_LIB_INT} + - ./${DB_LOG_INIT_EXT}:${DB_LOG_INIT_INT} + - ./${DB_LOG_SV_EXT}:${DB_LOG_SV_INT} + - ./${DB_LOG_MAIN_EXT}:${DB_LOG_MAIN_INT} + + networks: + - appl + + ports: + - "127.0.0.1:${DB_PORT_SV_EXT}:${DB_PORT_SV_INT}" +# - "127.0.0.1:${DB_PORT_MAIN_EXT}:${DB_PORT_MAIN_INT}" + + + +#------------------------------------------------------------------------------- + + webapp: + container_name: ${WA_HOST_NAME} + hostname: ${WA_HOST_NAME} + + image: ${WA_IMG_URL} + + build: + context: . + args: + IMG_NAME: ${WA_IMG_URL} + IMG_NAME_FULL: ${WA_IMG_NAME_FULL} + IMG_VERSION: ${WA_IMG_VERSION} + IMG_MAINTAINER: ${APPL_MAINTAINER} + IMG_URL: ${WA_IMG_URL} + IMG_FROM_URL: ${WA_IMG_FROM_URL} + + restart: unless-stopped + + depends_on: + database: + condition: service_healthy + + environment: + SERVER_CROND_ENABLED: ${WA_CROND_ENABLED} + + APACHE_UID: ${WA_USER_ID} + APACHE_GID: ${WA_GROUP_ID} + APACHE_DOC_ROOT: ${WA_APACHE_DOC_ROOT} + + PHP_UPLOAD_LIMIT: ${WA_PHP_UPLOAD_LIMIT} + + MEDSHAKE_URL: ${WA_MEDSHAKE_URL} + MEDSHAKE_ROOT_LINK_LIST: ${WA_MEDSHAKE_ROOT_LINK_LIST} + + DB_HOST: ${DB_HOST_NAME} + DB_DATABASE: ${DB_DB_NAME} + DB_USER: ${DB_DB_USER} + DB_PASSWORD: ${DB_DB_PASSWORD} + + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:${WA_PORT_MAIN_INT}/${WA_MEDSHAKE_URL}/"] + interval: 10s + timeout: 3s + retries: 3 + + volumes: + - ./${WA_LOG_INIT_EXT}:${WA_LOG_INIT_INT} + - ./${WA_LOG_SV_EXT}:${WA_LOG_SV_INT} + - ./${WA_LOG_HTTPD_EXT}:${WA_LOG_HTTPD_INT} + + - ./${WA_WWW_EXT}:${WA_WWW_INT} + + networks: + - appl + + ports: + - "127.0.0.1:${WA_PORT_SV_EXT}:${WA_PORT_SV_INT}" + - "127.0.0.1:${WA_PORT_MAIN_EXT}:${WA_PORT_MAIN_INT}" + +networks: + appl: + name: ${NETWORK_NAME} + driver: bridge + driver_opts: + com.docker.network.bridge.name: ${NETWORK_IF_NAME} diff --git a/env.dist b/env.dist new file mode 100644 index 0000000..65a63b8 --- /dev/null +++ b/env.dist @@ -0,0 +1,119 @@ +# Rx3-Docker/MedShake Docker Image +#------------------------------------------------------------------------------- + +#------------------------------------------------------------------------------- +# Global Settings +#------------------------------------------------------------------------------- + +ORG_NAME="rx3-docker" +ORG_REGISTRY="docker.xor.rx3:5000" +ORG_MAINTAINER='"Arnaud G. GIBERT" ' + +ORG_URL_PREFIX="${ORG_REGISTRY}/${ORG_NAME}" + + + +#------------------------------------------------------------------------------- +# Image Settings +#------------------------------------------------------------------------------- + +APPL_NAME="medshake" +APPL_NAME_FULL="MedShake Server" +APPL_NAME_SHORT="medshake" +APPL_ORG="rx3-docker" +APPL_VERSION="1.0.1" +APPL_MAINTAINER='"Arnaud G. GIBERT" ' + + + +#------------------------------------------------------------------------------- +# User Settings +#------------------------------------------------------------------------------- + +#APPL_ENV="prd" +#APPL_ENV="tst" +#APPL_ENV="int" +APPL_ENV="dvp" + + + +#------------------------------------------------------------------------------- +# Common +#------------------------------------------------------------------------------- + +if [[ "${APPL_ENV}" != "prd" ]] +then + APPL_SUFFIX="-${APPL_ENV}" +# PORT_ENV_OFFSET=100 + PORT_ENV_OFFSET=0 +else + APPL_SUFFIX="" + PORT_ENV_OFFSET=0 +fi + +ORG_URL_PREFIX="${ORG_REGISTRY}/${ORG_NAME}" +APPL_URL_PREFIX="${ORG_REGISTRY}/${APPL_ORG}/${APPL_NAME_SHORT}" + +HOST_NAME_PREFIX=${APPL_NAME_SHORT}${APPL_SUFFIX} + +#PORT_ENV_OFFSET=0 + +PORT_SV_INT=9001 +PORT_SV_OFFSET=1000 + +NETWORK_NAME=${HOST_NAME_PREFIX} +NETWORK_IF_NAME=br-${HOST_NAME_PREFIX} + +DOCKER_TOOLS_DEBUG=FALSE +DOCKER_TOOLS_VOLUME=MIXED +#DOCKER_TOOLS_VOLUME=MERGED +#DOCKER_TOOLS_EXEPTION_LIBS="postgres:pgsql" + + + +#------------------+----------+--------------------------+--------------------+------------------+-------------------------------+----------------------+--------------------+---------------+------------+--------------+------------+-------+-------+-------+-------+--------------+--------------+ +# | Variable | Service | Target Image | From Image | Module | Main Port | Admin Port | User | Group | +# | Prefix | Name | URL Prefix | Name | Name Full | Version | URL Prefix | Name | Version | Name | Version | Ext | Int | Ext | Int | Name / Id | Name / Id | +#------------------+----------+--------------------------+--------------------+------------------+-------------------------------+----------------------+--------------------+---------------+------------+--------------+------------+-------+-------+-------+-------+--------------+--------------+ + +docker_service_add DB database ${ORG_URL_PREFIX} mariadb - 1.2.0-mga9 - - - mysql - - 3306 - - mysql mysql + +docker_service_add WA webapp ${ORG_URL_PREFIX} medshake "Rx3-Docker/MedShake" ${APPL_VERSION}-mga9 ${ORG_URL_PREFIX} php-apache 1.7.0-mga9 - - 8178 80 - - apache apache + + + +#------------------------------------------------------------------------------- +# Database +#------------------------------------------------------------------------------- + +DB_ROOT_HOST='%' # needs to be enclosed with quotes +DB_ROOT_PASSWORD="mysqladmin" +DB_DB_NAME="medshake" +DB_DB_USER="medshake" +DB_DB_PASSWORD="medshakeadmin" + +DB_SERVER_NAME="MedShake" + + + +#------------------------------------------------------------------------------- +# WebApp +#------------------------------------------------------------------------------- + +WA_CROND_ENABLED="TRUE" + +WA_APACHE_DOC_ROOT="/var/www/html" +WA_PHP_UPLOAD_LIMIT="64M" + +WA_LOG_HTTPD_EXT="./var/log/httpd-webapp" +WA_LOG_HTTPD_INT="/var/log/httpd" + +WA_WWW_EXT=./var/www/${APPL_NAME} +WA_WWW_INT=/var/www/${APPL_NAME} + +#docker_config_add ${WA_CONF_EXT}/config_inc.php ${WA_CONF_EXT}/config_inc.php.ref + +WA_MEDSHAKE_URL="/medshake/" +#WA_SMTP_SERVER="mail.rx3.net" + +WA_MEDSHAKE_ROOT_LINK_LIST="ads.txt:security.txt" diff --git a/var/lib/mysql/.gitignore b/var/lib/mysql/.gitignore new file mode 100644 index 0000000..5e7d273 --- /dev/null +++ b/var/lib/mysql/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore diff --git a/var/log/httpd-webapp/.gitignore b/var/log/httpd-webapp/.gitignore new file mode 100644 index 0000000..5e7d273 --- /dev/null +++ b/var/log/httpd-webapp/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore diff --git a/var/log/init-database/.gitignore b/var/log/init-database/.gitignore new file mode 100644 index 0000000..5e7d273 --- /dev/null +++ b/var/log/init-database/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore diff --git a/var/log/init-webapp/.gitignore b/var/log/init-webapp/.gitignore new file mode 100644 index 0000000..5e7d273 --- /dev/null +++ b/var/log/init-webapp/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore diff --git a/var/log/supervisor-database/.gitignore b/var/log/supervisor-database/.gitignore new file mode 100644 index 0000000..5e7d273 --- /dev/null +++ b/var/log/supervisor-database/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore diff --git a/var/log/supervisor-webapp/.gitignore b/var/log/supervisor-webapp/.gitignore new file mode 100644 index 0000000..5e7d273 --- /dev/null +++ b/var/log/supervisor-webapp/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore