From d4717a55e8edbf1d4ef489b395de998055302c1c Mon Sep 17 00:00:00 2001 From: Kipchumba Bett Date: Thu, 28 Nov 2024 12:08:39 +0300 Subject: [PATCH] OZ-573: Switch to openmrs-core docker image + enable oauth2 at start time OpenMRS --- bundled-docker/openmrs/Dockerfile | 6 +----- docker-compose-openmrs-sso.yml | 3 ++- docker-compose-openmrs.yml | 4 +++- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/bundled-docker/openmrs/Dockerfile b/bundled-docker/openmrs/Dockerfile index a03d398..c74ee34 100644 --- a/bundled-docker/openmrs/Dockerfile +++ b/bundled-docker/openmrs/Dockerfile @@ -1,8 +1,4 @@ -FROM openmrs/openmrs-reference-application-3-backend:nightly - -# Remove modules & configurations from OpenMRS Reference Application -RUN find /openmrs/distribution/openmrs_modules -mindepth 1 -delete || true -RUN find /openmrs/distribution/openmrs_config -mindepth 1 -delete || true +FROM openmrs/openmrs-core:2.6.7 # Add modules & configurations for the ozone distribution ADD distro/binaries/openmrs/modules /openmrs/distribution/openmrs_modules diff --git a/docker-compose-openmrs-sso.yml b/docker-compose-openmrs-sso.yml index 4f5177f..674f4f4 100644 --- a/docker-compose-openmrs-sso.yml +++ b/docker-compose-openmrs-sso.yml @@ -2,8 +2,8 @@ services: openmrs: environment: KEYCLOAK_URL: ${SERVER_SCHEME}://${KEYCLOAK_HOSTNAME} + OAUTH2_ENABLED: ${ENABLE_SSO} volumes: - - "${OPENMRS_PROPERTIES_PATH}/oauth2.properties:/openmrs/data/oauth2.properties" - "./openmrs/tomcat/server.xml:/usr/local/tomcat/conf/server.xml" frontend: @@ -14,6 +14,7 @@ services: env-substitution: environment: + - OAUTH2_ENABLED=${ENABLE_SSO} - HOST_URL=${SERVER_SCHEME}://${O3_HOSTNAME} - KEYCLOAK_AUTH_SERVER_URL=${SERVER_SCHEME}://${KEYCLOAK_HOSTNAME} - OPENMRS_CLIENT_SECRET=${OPENMRS_CLIENT_SECRET} diff --git a/docker-compose-openmrs.yml b/docker-compose-openmrs.yml index 12bea30..716103e 100644 --- a/docker-compose-openmrs.yml +++ b/docker-compose-openmrs.yml @@ -16,13 +16,14 @@ services: OMRS_CONFIG_CONNECTION_USERNAME: ${OPENMRS_DB_USER:-openmrs} OMRS_CONFIG_CONNECTION_PASSWORD: ${OPENMRS_DB_PASSWORD:-openmrs} HOST_URL: https://${O3_HOSTNAME} + OAUTH2_ENABLED: ${ENABLE_SSO} healthcheck: test: [ "CMD", "curl", "-f", "http://localhost:8080/openmrs/health/started" ] interval: 10s timeout: 5s retries: 48 start_period: 120s - image: openmrs/openmrs-reference-application-3-backend:3.1.1 + image: openmrs/openmrs-core:2.6.7 labels: traefik.enable: "true" traefik.http.routers.openmrs.rule: "Host(`${O3_HOSTNAME}`) && PathPrefix(`/openmrs`)" @@ -44,6 +45,7 @@ services: - "${OPENMRS_CONFIG_CHECKSUMS_PATH:-openmrs-config-checksums}:/openmrs/data/configuration_checksums" - "${OPENMRS_PROPERTIES_PATH}:/etc/properties/" - "${OPENMRS_PROPERTIES_PATH}/fhirproxy.properties:/openmrs/data/fhirproxy/config.properties" + - "${OPENMRS_PROPERTIES_PATH}/oauth2.properties:/openmrs/data/oauth2.properties" # OpenMRS 3 Frontend frontend: